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;
}
Aggregations