Search in sources :

Example 76 with QueryFactory

use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.

the class ListTileCache method getCachedTile.

public static byte[] getCachedTile(String versionId, int x, int y, int zoom) {
    ListTileCacheQuery query = new ListTileCacheQuery(new QueryFactory());
    query.WHERE(query.getVersion().EQ(versionId));
    query.AND(query.getX().EQ(x));
    query.AND(query.getY().EQ(y));
    query.AND(query.getZ().EQ(zoom));
    OIterator<? extends ListTileCache> it = query.getIterator();
    try {
        if (it.hasNext()) {
            ListTileCache tile = it.next();
            return tile.getTile();
        }
        return null;
    } finally {
        it.close();
    }
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory)

Example 77 with QueryFactory

use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.

the class ListTileCache method deleteTiles.

public static void deleteTiles(ListTypeVersion version) {
    ListTileCacheQuery query = new ListTileCacheQuery(new QueryFactory());
    query.WHERE(query.getVersion().EQ(version));
    try (OIterator<? extends ListTileCache> it = query.getIterator()) {
        while (it.hasNext()) {
            it.next().delete();
        }
    }
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory)

Example 78 with QueryFactory

use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.

the class ListType method getVersions.

public List<ListTypeVersion> getVersions() {
    ListTypeVersionQuery query = new ListTypeVersionQuery(new QueryFactory());
    query.WHERE(query.getListType().EQ(this));
    query.ORDER_BY_DESC(query.getForDate());
    try (OIterator<? extends ListTypeVersion> it = query.getIterator()) {
        return new LinkedList<ListTypeVersion>(it.getAll());
    }
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory) LinkedList(java.util.LinkedList)

Example 79 with QueryFactory

use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.

the class ListType method getEntries.

public List<ListTypeEntry> getEntries() {
    ListTypeEntryQuery query = new ListTypeEntryQuery(new QueryFactory());
    query.WHERE(query.getListType().EQ(this));
    query.ORDER_BY_DESC(query.getForDate());
    try (OIterator<? extends ListTypeEntry> it = query.getIterator()) {
        return new LinkedList<ListTypeEntry>(it.getAll());
    }
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory) LinkedList(java.util.LinkedList)

Example 80 with QueryFactory

use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.

the class ListType method createMdAttribute.

public static void createMdAttribute(ServerGeoObjectType type, AttributeType attributeType) {
    Collection<Locale> locales = LocalizationFacade.getInstalledLocales();
    ListTypeQuery query = new ListTypeQuery(new QueryFactory());
    query.WHERE(query.getUniversal().EQ(type.getUniversal()));
    List<? extends ListType> lists = query.getIterator().getAll();
    for (ListType list : lists) {
        list.createMdAttributeFromAttributeType(type, attributeType, locales);
    }
}
Also used : Locale(java.util.Locale) QueryFactory(com.runwaysdk.query.QueryFactory)

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