use of com.runwaysdk.business.graph.GraphQuery in project geoprism-registry by terraframe.
the class ExternalSystem method getReferencedDataCount.
public long getReferencedDataCount() {
final MdEdgeDAOIF mdEdge = MdEdgeDAO.getMdEdgeDAO(GeoVertex.EXTERNAL_ID);
StringBuilder builder = new StringBuilder();
builder.append("SELECT COUNT(*) FROM " + mdEdge.getDBClassName());
builder.append(" WHERE out = :system");
final GraphQuery<Long> query = new GraphQuery<Long>(builder.toString());
query.setParameter("system", this.getRID());
return query.getSingleResult();
}
use of com.runwaysdk.business.graph.GraphQuery in project geoprism-registry by terraframe.
the class FhirExternalSystem method getAll.
public static List<FhirExternalSystem> getAll() {
final MdVertexDAOIF mdVertex = MdVertexDAO.getMdVertexDAO(FhirExternalSystem.CLASS);
StringBuilder builder = new StringBuilder();
builder.append("SELECT FROM " + mdVertex.getDBClassName());
final GraphQuery<FhirExternalSystem> query = new GraphQuery<FhirExternalSystem>(builder.toString());
return query.getResults();
}
use of com.runwaysdk.business.graph.GraphQuery in project geoprism-registry by terraframe.
the class Transition method removeAll.
@Transaction
public static void removeAll(ServerGeoObjectType type) {
MdVertexDAOIF mdVertex = MdVertexDAO.getMdVertexDAO(Transition.CLASS);
MdAttributeDAOIF sourceAttribute = mdVertex.definesAttribute(Transition.SOURCE);
MdAttributeDAOIF targetAttribute = mdVertex.definesAttribute(Transition.TARGET);
StringBuilder statement = new StringBuilder();
statement.append("SELECT FROM " + mdVertex.getDBClassName());
statement.append(" WHERE " + sourceAttribute.getColumnName() + ".@class = :vertexClass");
statement.append(" OR " + targetAttribute.getColumnName() + ".@class = :vertexClass");
GraphQuery<Transition> query = new GraphQuery<Transition>(statement.toString());
query.setParameter("vertexClass", type.getMdVertex().getDBClassName());
List<Transition> 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 page.
public static Page<TransitionEvent> page(Integer pageSize, Integer pageNumber, String attrConditions) {
Long count = getCount();
MdVertexDAOIF mdVertex = MdVertexDAO.getMdVertexDAO(TransitionEvent.CLASS);
MdAttributeDAOIF eventDate = mdVertex.definesAttribute(TransitionEvent.EVENTDATE);
Map<String, Object> parameters = new HashMap<String, Object>();
StringBuilder statement = new StringBuilder();
statement.append("SELECT FROM " + mdVertex.getDBClassName());
addPageWhereCriteria(statement, parameters, attrConditions);
statement.append(" ORDER BY " + eventDate.getColumnName() + " DESC");
statement.append(" SKIP " + ((pageNumber - 1) * pageSize) + " LIMIT " + pageSize);
GraphQuery<TransitionEvent> query = new GraphQuery<TransitionEvent>(statement.toString(), parameters);
return new Page<TransitionEvent>(count, pageNumber, pageSize, query.getResults());
}
use of com.runwaysdk.business.graph.GraphQuery in project geoprism-registry by terraframe.
the class TransitionEvent method getTransitions.
public List<Transition> getTransitions() {
MdVertexDAOIF mdVertex = MdVertexDAO.getMdVertexDAO(Transition.CLASS);
MdAttributeDAOIF mdAttribute = mdVertex.definesAttribute(Transition.EVENT);
// MdAttributeDAOIF sourceAttribute = mdVertex.definesAttribute(Transition.SOURCE);
MdAttributeDAOIF targetAttribute = mdVertex.definesAttribute(Transition.TARGET);
MdAttributeDAOIF orderAttribute = mdVertex.definesAttribute(Transition.ORDER);
StringBuilder statement = new StringBuilder();
statement.append("SELECT FROM " + mdVertex.getDBClassName());
statement.append(" WHERE " + mdAttribute.getColumnName() + " = :event");
statement.append(" ORDER BY " + orderAttribute.getColumnName() + " ASC");
statement.append(", " + targetAttribute.getColumnName() + ".code");
GraphQuery<Transition> query = new GraphQuery<Transition>(statement.toString());
query.setParameter("event", this.getRID());
List<Transition> results = query.getResults();
return results;
}
Aggregations