use of com.runwaysdk.business.BusinessQuery in project geoprism-registry by terraframe.
the class ListTypeShapefileExporter method features.
public FeatureCollection<SimpleFeatureType, SimpleFeature> features(SimpleFeatureType featureType) {
List<SimpleFeature> features = new ArrayList<SimpleFeature>();
SimpleFeatureBuilder builder = new SimpleFeatureBuilder(featureType);
BusinessQuery query = this.version.buildQuery(this.criteria);
query.ORDER_BY_DESC(query.aCharacter(DefaultAttribute.CODE.getName()));
OIterator<Business> objects = query.getIterator();
try {
while (objects.hasNext()) {
Business row = objects.next();
builder.set(GEOM, row.getObjectValue(RegistryConstants.GEOMETRY_ATTRIBUTE_NAME));
for (MdAttributeConcreteDAOIF mdAttribute : mdAttributes) {
String attributeName = mdAttribute.definesAttribute();
Object value = row.getObjectValue(attributeName);
if (value != null) {
builder.set(this.getColumnName(attributeName), value);
}
}
SimpleFeature feature = builder.buildFeature(row.getValue(DefaultAttribute.CODE.getName()));
features.add(feature);
}
} finally {
objects.close();
}
return new ListFeatureCollection(featureType, features);
}
use of com.runwaysdk.business.BusinessQuery in project geoprism-registry by terraframe.
the class TestGeoObjectInfo method deleteInTrans.
// @Transaction
// private void deleteInTrans()
// {
// if (this.testDataSet.debugMode >= 1)
// {
// System.out.println("Deleting TestGeoObjectInfo [" + this.getCode() + "].");
// }
//
// ServerGeoObjectIF serverGO = this.getServerObject();
//
// if (serverGO != null)
// {
// serverGO.delete();
// }
//
// this.children.clear();
//
// this.business = null;
// this.geoEntity = null;
// }
//
// private ServerGeoObjectIF getServerObject()
// {
//
// }
@Transaction
private void deleteInTrans() {
// geoEntity it nulls out the reference in the table.
if (this.getGeoObjectType() != null && this.getGeoObjectType().getUniversal() != null) {
QueryFactory qf = new QueryFactory();
BusinessQuery bq = qf.businessQuery(this.getGeoObjectType().getUniversal().getMdBusiness().definesType());
bq.WHERE(bq.aCharacter(DefaultAttribute.CODE.getName()).EQ(this.getCode()));
OIterator<? extends Business> bit = bq.getIterator();
try {
while (bit.hasNext()) {
Business biz = bit.next();
biz.delete();
}
} finally {
bit.close();
}
}
TestDataSet.deleteGeoEntity(this.getCode());
// if (this.serverGO instanceof CompositeServerGeoObject)
// {
// ((CompositeServerGeoObject)this.serverGO).getVertex().getVertex().delete();
// }
// else if (this.serverGO instanceof VertexServerGeoObject)
// {
// ((VertexServerGeoObject)this.serverGO).getVertex().delete();
// }
ServerGeoObjectType serverGOTT = this.geoObjectType.getServerObject();
if (serverGOTT != null) {
VertexObject vertex = VertexServerGeoObject.getVertexByCode(serverGOTT, this.getCode());
if (vertex != null) {
vertex.delete();
}
}
this.children.clear();
this.isNew = true;
}
Aggregations