Revision 44361 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/H2SpatialSQLBuilder.java
H2SpatialSQLBuilder.java | ||
---|---|---|
190 | 190 |
String sql; |
191 | 191 |
String constraint_name = "constraint_" + this.table().getName() + "_" + column.getName()+"_dim"; |
192 | 192 |
sql = MessageFormat.format( |
193 |
"ALTER TABLE \"{0}\" ADD CONSTRAINT IF NOT EXISTS \"{1}\" CHECK ST_CoordDim(\"{2}\") = {3}", |
|
193 |
"ALTER TABLE \"{0}\".\"{1}\" ADD CONSTRAINT IF NOT EXISTS \"{2}\" CHECK ST_CoordDim(\"{3}\") = {4}", |
|
194 |
this.table().getSchema(), |
|
194 | 195 |
this.table().getName(), |
195 | 196 |
constraint_name, |
196 | 197 |
column.getName(), |
... | ... | |
232 | 233 |
String sql; |
233 | 234 |
String constraint_name = "constraint_" + this.table().getName() + "_" + column.getName()+"_dim"; |
234 | 235 |
sql = MessageFormat.format( |
235 |
"ALTER TABLE \"{0}\" ADD CONSTRAINT IF NOT EXISTS \"{1}\" CHECK ST_CoordDim(\"{2}\") = {3}", |
|
236 |
"ALTER TABLE \"{0}\".\"{1}\" ADD CONSTRAINT IF NOT EXISTS \"{2}\" CHECK ST_CoordDim(\"{3}\") = {4}", |
|
237 |
this.table().getSchema(), |
|
236 | 238 |
this.table().getName(), |
237 | 239 |
constraint_name, |
238 | 240 |
column.getName(), |
... | ... | |
325 | 327 |
String sql; |
326 | 328 |
String constraint_name = "constraint_" + this.table().getName() + "_" + column.getName()+"_dim"; |
327 | 329 |
sql = MessageFormat.format( |
328 |
"ALTER TABLE \"{0}\" ADD CONSTRAINT IF NOT EXISTS \"{1}\" CHECK NVL2(\"{2}\", ST_CoordDim(\"{2}\") = {3}, TRUE)", |
|
330 |
"ALTER TABLE \"{0}\".\"{1}\" ADD CONSTRAINT IF NOT EXISTS \"{2}\" CHECK NVL2(\"{3}\", ST_CoordDim(\"{3}\") = {4}, TRUE)", |
|
331 |
this.table().getSchema(), |
|
329 | 332 |
this.table().getName(), |
330 | 333 |
constraint_name, |
331 | 334 |
column.getName(), |
... | ... | |
335 | 338 |
String sql2; |
336 | 339 |
String constraint_name2 = "constraint_" + this.table().getName() + "_" + column.getName()+"_srid"; |
337 | 340 |
sql2 = MessageFormat.format( |
338 |
"ALTER TABLE \"{0}\" ADD CONSTRAINT IF NOT EXISTS \"{1}\" CHECK NVL2(\"{2}\", ST_SRID(\"{2}\") = {3,number,#####}, TRUE)", |
|
339 |
this.table().getName(), // 0 |
|
340 |
constraint_name2, // 1 |
|
341 |
column.getName(), // 2 |
|
342 |
column.getGeometrySRSId() // 3 |
|
341 |
"ALTER TABLE \"{0}\".\"{1}\" ADD CONSTRAINT IF NOT EXISTS \"{2}\" CHECK NVL2(\"{3}\", ST_SRID(\"{3}\") = {4,number,#####}, TRUE)", |
|
342 |
this.table().getSchema(), // 0 |
|
343 |
this.table().getName(), // 1 |
|
344 |
constraint_name2, // 2 |
|
345 |
column.getName(), // 3 |
|
346 |
column.getGeometrySRSId() // 4 |
|
343 | 347 |
); |
344 | 348 |
sqls.add(sql2); |
345 | 349 |
} |
Also available in: Unified diff