use of com.runwaysdk.business.graph.GraphQuery in project geoprism-registry by terraframe.
the class FhirExternalSystem method isFhirOauth.
public static boolean isFhirOauth(OauthServer server) {
final MdVertexDAOIF mdVertex = MdVertexDAO.getMdVertexDAO(FhirExternalSystem.CLASS);
MdAttributeDAOIF mdAttribute = mdVertex.definesAttribute(OAUTHSERVER);
StringBuilder builder = new StringBuilder();
builder.append("SELECT COUNT(*) FROM " + mdVertex.getDBClassName());
builder.append(" WHERE " + mdAttribute.getColumnName() + " = :server");
final GraphQuery<Long> query = new GraphQuery<Long>(builder.toString());
query.setParameter("server", server.getOid());
return (query.getSingleResult() > 0);
}
use of com.runwaysdk.business.graph.GraphQuery in project geoprism-registry by terraframe.
the class Transition method getVertex.
private VertexServerGeoObject getVertex(String attributeName) {
MdVertexDAOIF mdVertex = MdVertexDAO.getMdVertexDAO(Transition.CLASS);
MdAttributeDAOIF mdAttribute = mdVertex.definesAttribute(attributeName);
StringBuilder statement = new StringBuilder();
statement.append("SELECT expand(" + mdAttribute.getColumnName() + ")");
statement.append(" FROM :parent");
GraphQuery<VertexObject> query = new GraphQuery<VertexObject>(statement.toString());
query.setParameter("parent", this.getRID());
VertexObject vertex = query.getSingleResult();
MdVertexDAOIF geoVertex = (MdVertexDAOIF) vertex.getMdClass();
ServerGeoObjectType type = ServerGeoObjectType.get(geoVertex);
return new VertexServerGeoObject(type, vertex);
}
use of com.runwaysdk.business.graph.GraphQuery in project geoprism-registry by terraframe.
the class TransitionEvent method removeAll.
@Transaction
public static void removeAll(ServerGeoObjectType type) {
MdVertexDAOIF mdVertex = MdVertexDAO.getMdVertexDAO(TransitionEvent.CLASS);
MdAttributeDAOIF beforeTypeCode = mdVertex.definesAttribute(TransitionEvent.BEFORETYPECODE);
MdAttributeDAOIF afterTypeCode = mdVertex.definesAttribute(TransitionEvent.AFTERTYPECODE);
StringBuilder statement = new StringBuilder();
statement.append("SELECT FROM " + mdVertex.getDBClassName());
statement.append(" WHERE " + beforeTypeCode.getColumnName() + " = :typeCode OR " + afterTypeCode.getColumnName() + " = :typeCode");
GraphQuery<TransitionEvent> query = new GraphQuery<TransitionEvent>(statement.toString());
query.setParameter("typeCode", type.getCode());
List<TransitionEvent> results = query.getResults();
results.forEach(event -> event.delete());
}
use of com.runwaysdk.business.graph.GraphQuery in project geoprism-registry by terraframe.
the class TransitionEvent method getCount.
public static Long getCount() {
MdVertexDAOIF mdVertex = MdVertexDAO.getMdVertexDAO(TransitionEvent.CLASS);
StringBuilder statement = new StringBuilder();
statement.append("SELECT COUNT(*) FROM " + mdVertex.getDBClassName());
GraphQuery<Long> query = new GraphQuery<Long>(statement.toString());
return query.getSingleResult();
}
use of com.runwaysdk.business.graph.GraphQuery in project geoprism-registry by terraframe.
the class PatchExistsAndInvalidInstanceData method getInstanceData.
private List<VertexServerGeoObject> getInstanceData(ServerGeoObjectType type, MdGraphClassDAOIF mdClass) {
StringBuilder statement = new StringBuilder();
statement.append("SELECT FROM " + mdClass.getDBClassName());
GraphQuery<VertexObject> vertexQuery = new GraphQuery<VertexObject>(statement.toString(), new HashMap<String, Object>());
List<VertexServerGeoObject> list = new LinkedList<VertexServerGeoObject>();
List<VertexObject> results = vertexQuery.getResults();
for (VertexObject result : results) {
list.add(new VertexServerGeoObject(type, result, today));
}
return list;
}
Aggregations