Revision 44198 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.db/org.gvsig.fmap.dal.db.h2/src/main/java/org/gvsig/fmap/dal/store/h2/operations/H2SpatialAppendOperation.java
H2SpatialAppendOperation.java | ||
---|---|---|
3 | 3 |
|
4 | 4 |
import java.sql.PreparedStatement; |
5 | 5 |
import java.sql.SQLException; |
6 |
import org.gvsig.expressionevaluator.ExpressionBuilder; |
|
6 | 7 |
import org.gvsig.fmap.dal.DataTypes; |
7 | 8 |
import org.gvsig.fmap.dal.exception.DataException; |
8 | 9 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
... | ... | |
20 | 21 |
|
21 | 22 |
@SuppressWarnings("UseSpecificCatch") |
22 | 23 |
public class H2SpatialAppendOperation extends AppendOperation { |
23 |
|
|
24 |
|
|
24 | 25 |
public H2SpatialAppendOperation( |
25 | 26 |
JDBCHelper helper, |
26 | 27 |
TableReference table, |
... | ... | |
39 | 40 |
this.connection = this.helper.getConnectionWritable(); |
40 | 41 |
|
41 | 42 |
this.sqlbuilder = this.helper.createSQLBuilder(); |
43 |
this.expbuilder = this.sqlbuilder.expression(); |
|
42 | 44 |
|
43 | 45 |
this.sqlbuilder.insert().table() |
44 | 46 |
.database(this.table.getDatabase()) |
... | ... | |
50 | 52 |
} |
51 | 53 |
if (attr.getType() == DataTypes.GEOMETRY) { |
52 | 54 |
this.sqlbuilder.insert().column().name(attr.getName()).with_value( |
53 |
sqlbuilder.parameter(attr.getName()).as_geometry_variable().srs(
|
|
54 |
sqlbuilder.parameter().value(attr.getSRS())
|
|
55 |
this.expbuilder.parameter(attr.getName()).as_geometry_variable().srs(
|
|
56 |
this.expbuilder.parameter().value(attr.getSRS())
|
|
55 | 57 |
) |
56 | 58 |
); |
57 | 59 |
} else { |
58 | 60 |
this.sqlbuilder.insert().column().name(attr.getName()).with_value( |
59 |
sqlbuilder.parameter(attr.getName()).as_variable()
|
|
61 |
this.expbuilder.parameter(attr.getName()).as_variable()
|
|
60 | 62 |
); |
61 | 63 |
} |
62 | 64 |
} |
Also available in: Unified diff