use of com.runwaysdk.dataaccess.AttributeReferenceIF in project geoprism-registry by terraframe.
the class HierarchyExporter method exportUniversalInstances.
/**
* Export all instances of the given {@link Universal} type.
*
* @param universal
*/
private static void exportUniversalInstances(ExportMetadata exportMetadata, Universal universal) {
boolean isLeafType = universal.getIsLeafType();
MdBusiness mdBusiness = universal.getMdBusiness();
QueryFactory qf = new QueryFactory();
BusinessDAOQuery q = qf.businessDAOQuery(mdBusiness.definesType());
System.out.println("\nExporting Universal [" + universal.getUniversalId() + "] instances:");
System.out.println("-----------------------------------------------------------------------");
int counter = 0;
OIterator<BusinessDAOIF> i = q.getIterator();
try {
for (BusinessDAOIF businessDAOIF : i) {
if (!isLeafType) {
BusinessDAOIF geoEntity = ((AttributeReferenceIF) businessDAOIF.getAttributeIF(RegistryConstants.GEO_ENTITY_ATTRIBUTE_NAME)).dereference();
exportMetadata.addCreate(geoEntity);
}
exportMetadata.addCreate(businessDAOIF);
System.out.print(".");
if (counter % 100 == 0) {
System.out.println();
}
counter++;
}
} finally {
i.close();
}
}
Aggregations