Search in sources :

Example 1 with MdVertexQuery

use of com.runwaysdk.system.metadata.MdVertexQuery in project geoprism-registry by terraframe.

the class VertexServerGeoObject method findTypeOfGeoObjectCode.

/**
 * Finds the ServerGeoObjectType associated with the particular Geo-Object
 * code.
 *
 * @return
 */
public static ServerGeoObjectType findTypeOfGeoObjectCode(String code) {
    StringBuilder statement = new StringBuilder();
    statement.append("SELECT @class FROM geo_vertex WHERE code=:code");
    GraphQuery<String> query = new GraphQuery<String>(statement.toString());
    query.setParameter("code", code);
    String className = query.getSingleResult();
    MdVertexQuery mvq = new MdVertexQuery(new QueryFactory());
    mvq.WHERE(mvq.getDbClassName().EQ(className));
    MdVertex mdVertex = mvq.getIterator().getAll().get(0);
    ServerGeoObjectType foundType = ServerGeoObjectType.get(MdGeoVertexDAO.get(mdVertex.getOid()));
    return foundType;
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory) MdVertex(com.runwaysdk.system.metadata.MdVertex) ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) MdVertexQuery(com.runwaysdk.system.metadata.MdVertexQuery) MultiLineString(com.vividsolutions.jts.geom.MultiLineString) LineString(com.vividsolutions.jts.geom.LineString) GraphQuery(com.runwaysdk.business.graph.GraphQuery)

Aggregations

GraphQuery (com.runwaysdk.business.graph.GraphQuery)1 QueryFactory (com.runwaysdk.query.QueryFactory)1 MdVertex (com.runwaysdk.system.metadata.MdVertex)1 MdVertexQuery (com.runwaysdk.system.metadata.MdVertexQuery)1 LineString (com.vividsolutions.jts.geom.LineString)1 MultiLineString (com.vividsolutions.jts.geom.MultiLineString)1 ServerGeoObjectType (net.geoprism.registry.model.ServerGeoObjectType)1