Revision 44678 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/TableIsEmptyOperation.java
TableIsEmptyOperation.java | ||
---|---|---|
4 | 4 |
import java.sql.ResultSet; |
5 | 5 |
import java.sql.SQLException; |
6 | 6 |
import java.sql.Statement; |
7 |
import java.util.List; |
|
7 | 8 |
import org.apache.commons.lang3.StringUtils; |
8 | 9 |
import org.gvsig.expressionevaluator.ExpressionBuilder; |
9 | 10 |
import org.gvsig.fmap.dal.exception.DataException; |
... | ... | |
45 | 46 |
|
46 | 47 |
@Override |
47 | 48 |
public final Object perform(Connection conn) throws DataException { |
48 |
return this.tableIsEmpty(conn, featureType, table, baseFilter, filter);
|
|
49 |
return this.tableIsEmpty(conn); |
|
49 | 50 |
} |
50 | 51 |
|
51 |
public boolean tableIsEmpty(Connection conn, |
|
52 |
FeatureType featureType, |
|
53 |
TableReference table, |
|
54 |
String baseFilter, |
|
55 |
String filter |
|
56 |
) throws DataException { |
|
57 |
|
|
52 |
public String getSQL() { |
|
58 | 53 |
JDBCSQLBuilderBase sqlbuilder = this.createSQLBuilder(); |
59 | 54 |
ExpressionBuilder expbuilder = sqlbuilder.expression(); |
60 | 55 |
|
... | ... | |
78 | 73 |
PROP_TABLE, table |
79 | 74 |
); |
80 | 75 |
String sql = sqlbuilder.select().toString(); |
76 |
return sql; |
|
77 |
} |
|
78 |
|
|
79 |
public boolean tableIsEmpty(Connection conn) throws DataException { |
|
80 |
String sql = this.getSQL(); |
|
81 | 81 |
|
82 | 82 |
Statement st = null; |
83 | 83 |
ResultSet rs = null; |
Also available in: Unified diff