use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.
the class MasterList method getVersions.
public List<MasterListVersion> getVersions(String versionType) {
MasterListVersionQuery query = new MasterListVersionQuery(new QueryFactory());
query.WHERE(query.getMasterlist().EQ(this));
if (versionType != null) {
query.AND(query.getVersionType().EQ(versionType));
}
query.ORDER_BY_DESC(query.getForDate());
try (OIterator<? extends MasterListVersion> it = query.getIterator()) {
return new LinkedList<MasterListVersion>(it.getAll());
}
}
use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.
the class MasterList method createMdAttribute.
public static void createMdAttribute(ServerGeoObjectType type, AttributeType attributeType) {
Collection<Locale> locales = LocalizationFacade.getInstalledLocales();
MasterListQuery query = new MasterListQuery(new QueryFactory());
query.WHERE(query.getUniversal().EQ(type.getUniversal()));
List<? extends MasterList> lists = query.getIterator().getAll();
for (MasterList list : lists) {
list.createMdAttributeFromAttributeType(type, attributeType, locales);
}
}
use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.
the class MasterListAttributeGroup method deleteAll.
public static void deleteAll(MasterListVersion version) {
MasterListAttributeGroupQuery query = new MasterListAttributeGroupQuery(new QueryFactory());
query.WHERE(query.getVersion().EQ(version));
OIterator<? extends MasterListAttributeGroup> it = query.getIterator();
try {
List<? extends MasterListAttributeGroup> groups = it.getAll();
for (MasterListAttributeGroup group : groups) {
group.delete();
}
} finally {
it.close();
}
}
use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.
the class MasterListVersion method getAll.
public static List<? extends MasterListVersion> getAll(String versionType) {
MasterListVersionQuery query = new MasterListVersionQuery(new QueryFactory());
query.WHERE(query.getVersionType().EQ(versionType));
try (OIterator<? extends MasterListVersion> it = query.getIterator()) {
return it.getAll();
}
}
use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.
the class MasterListVersion method buildQuery.
public BusinessQuery buildQuery(String filterJson) {
MdBusinessDAOIF mdBusiness = MdBusinessDAO.get(this.getMdBusinessOid());
BusinessQuery query = new QueryFactory().businessQuery(mdBusiness.definesType());
Map<MdAttributeConcreteDAOIF, Condition> conditionMap = this.buildQueryConditionsFromFilter(filterJson, null, query, mdBusiness);
for (Condition condition : conditionMap.values()) {
query.WHERE(condition);
}
return query;
}
Aggregations