use of net.geoprism.registry.model.GeoObjectTypeMetadataQuery in project geoprism-registry by terraframe.
the class PatchGeoObjectTypeMetadata method doIt.
@Transaction
private void doIt() {
QueryFactory qf = new QueryFactory();
UniversalQuery uq = new UniversalQuery(qf);
OIterator<? extends Universal> it = uq.getIterator();
try {
while (it.hasNext()) {
Universal uni = it.next();
if (uni.getKey().equals(Universal.ROOT_KEY)) {
continue;
}
GeoObjectTypeMetadataQuery query = new GeoObjectTypeMetadataQuery(new QueryFactory());
query.WHERE(query.getKeyName().EQ(uni.getKey()));
OIterator<? extends GeoObjectTypeMetadata> it2 = query.getIterator();
try {
if (!it2.hasNext()) {
GeoObjectTypeMetadata metadata = new GeoObjectTypeMetadata();
metadata.setUniversal(uni);
metadata.setIsPrivate(false);
metadata.apply();
}
} finally {
it2.close();
}
}
} finally {
it.close();
}
}
Aggregations