Revision 44058 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.db/org.gvsig.fmap.dal.db.jdbc/src/main/java/org/gvsig/fmap/dal/store/jdbc2/spi/operations/UpdateTableStatisticsOperation.java

View differences:

UpdateTableStatisticsOperation.java
9 9
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase;
10 10
import org.gvsig.fmap.dal.store.jdbc.exception.JDBCSQLException;
11 11
import org.gvsig.fmap.dal.store.jdbc2.JDBCUtils;
12
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory.TableReference;
12 13

  
13 14
public class UpdateTableStatisticsOperation extends AbstractConnectionWritableOperation {
14 15

  
15
    private final String schemaName;
16
    private final String tableName;
17
    private final String dbName;
16
    private final TableReference table;
18 17

  
19 18
    public UpdateTableStatisticsOperation(
20 19
            JDBCHelper helper
21 20
        ) {
22
        this(helper, null, null, null);
21
        this(helper, null);
23 22
    }
24 23

  
25 24
    public UpdateTableStatisticsOperation(
26 25
            JDBCHelper helper,
27
            String dbName,
28
            String schemaName,
29
            String tableName
26
            TableReference table
30 27
        ) {
31 28
        super(helper);
32
        this.dbName = dbName;
33
        this.schemaName = schemaName;
34
        this.tableName = tableName;
29
        this.table = table;
35 30
    }
36 31

  
37 32
    @Override
38 33
    public final Object perform(Connection conn) throws DataException {
39
        this.updateTableStatistics(conn, dbName, schemaName, tableName);
34
        this.updateTableStatistics(conn, table);
40 35
        return true;
41 36
    }
42 37

  
43 38
    public void updateTableStatistics(
44 39
            Connection conn,
45
            String database,
46
            String schema,
47
            String table
40
            TableReference table
48 41
        ) throws DataException {
49 42

  
50 43
        JDBCSQLBuilderBase sqlbuilder = this.createSQLBuilder();
51
        sqlbuilder.update_table_statistics().table().database(database).schema(schema).name(table);
52

  
44
        sqlbuilder.update_table_statistics().table()
45
                .database(this.table.getDatabase())
46
                .schema(this.table.getSchema())
47
                .name(this.table.getTable());
53 48
        List<String> sqls;
54 49
        sqls = sqlbuilder.update_table_statistics().toStrings();
55 50

  

Also available in: Unified diff