Search in sources :

Example 91 with QueryFactory

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());
    }
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory) LinkedList(java.util.LinkedList)

Example 92 with QueryFactory

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);
    }
}
Also used : Locale(java.util.Locale) QueryFactory(com.runwaysdk.query.QueryFactory)

Example 93 with QueryFactory

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();
    }
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory)

Example 94 with QueryFactory

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();
    }
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory)

Example 95 with QueryFactory

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;
}
Also used : BusinessQuery(com.runwaysdk.business.BusinessQuery) Condition(com.runwaysdk.query.Condition) BasicCondition(com.runwaysdk.query.BasicCondition) MdBusinessDAOIF(com.runwaysdk.dataaccess.MdBusinessDAOIF) QueryFactory(com.runwaysdk.query.QueryFactory) MdAttributeConcreteDAOIF(com.runwaysdk.dataaccess.MdAttributeConcreteDAOIF)

Aggregations

QueryFactory (com.runwaysdk.query.QueryFactory)158 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)37 LinkedList (java.util.LinkedList)35 Request (com.runwaysdk.session.Request)31 JsonArray (com.google.gson.JsonArray)19 JsonObject (com.google.gson.JsonObject)19 ServerGeoObjectType (net.geoprism.registry.model.ServerGeoObjectType)19 SimpleDateFormat (java.text.SimpleDateFormat)15 List (java.util.List)14 Date (java.util.Date)13 ChangeRequest (net.geoprism.registry.action.ChangeRequest)13 OIterator (com.runwaysdk.query.OIterator)12 Universal (com.runwaysdk.system.gis.geo.Universal)12 ChangeRequestQuery (net.geoprism.registry.action.ChangeRequestQuery)12 ServerHierarchyType (net.geoprism.registry.model.ServerHierarchyType)11 BusinessQuery (com.runwaysdk.business.BusinessQuery)10 Session (com.runwaysdk.session.Session)10 GeoprismUser (net.geoprism.GeoprismUser)10 ProgrammingErrorException (com.runwaysdk.dataaccess.ProgrammingErrorException)9 MdBusinessDAOIF (com.runwaysdk.dataaccess.MdBusinessDAOIF)8