Search in sources :

Example 1 with GeoObjectTypeMetadataQuery

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();
    }
}
Also used : GeoObjectTypeMetadata(net.geoprism.registry.model.GeoObjectTypeMetadata) QueryFactory(com.runwaysdk.query.QueryFactory) Universal(com.runwaysdk.system.gis.geo.Universal) UniversalQuery(com.runwaysdk.system.gis.geo.UniversalQuery) GeoObjectTypeMetadataQuery(net.geoprism.registry.model.GeoObjectTypeMetadataQuery) Transaction(com.runwaysdk.dataaccess.transaction.Transaction)

Aggregations

Transaction (com.runwaysdk.dataaccess.transaction.Transaction)1 QueryFactory (com.runwaysdk.query.QueryFactory)1 Universal (com.runwaysdk.system.gis.geo.Universal)1 UniversalQuery (com.runwaysdk.system.gis.geo.UniversalQuery)1 GeoObjectTypeMetadata (net.geoprism.registry.model.GeoObjectTypeMetadata)1 GeoObjectTypeMetadataQuery (net.geoprism.registry.model.GeoObjectTypeMetadataQuery)1