Search in sources :

Example 1 with GraphDBService

use of com.runwaysdk.dataaccess.graph.GraphDBService in project geoprism-registry by terraframe.

the class CRAttributePatch method executeGraphDDLCommand.

public void executeGraphDDLCommand(String sql) {
    GraphDBService service = GraphDBService.getInstance();
    GraphRequest dml = service.getGraphDBRequest();
    GraphRequest ddl = service.getDDLGraphDBRequest();
    GraphDDLCommandAction action = service.ddlCommand(dml, ddl, sql, new HashMap<String, Object>());
    action.execute();
}
Also used : GraphRequest(com.runwaysdk.dataaccess.graph.GraphRequest) GraphDDLCommandAction(com.runwaysdk.dataaccess.graph.GraphDDLCommandAction) VertexObject(com.runwaysdk.business.graph.VertexObject) GraphDBService(com.runwaysdk.dataaccess.graph.GraphDBService)

Example 2 with GraphDBService

use of com.runwaysdk.dataaccess.graph.GraphDBService in project geoprism-registry by terraframe.

the class CreateEventSequencePatch method doIt.

@Request
private void doIt() {
    StringBuilder statement = new StringBuilder();
    statement.append("CREATE SEQUENCE " + TransitionEvent.EVENT_SEQUENCE + " TYPE ORDERED");
    GraphDBService service = GraphDBService.getInstance();
    GraphRequest graphRequest = service.getGraphDBRequest();
    service.command(graphRequest, statement.toString(), new HashedMap<>());
}
Also used : GraphRequest(com.runwaysdk.dataaccess.graph.GraphRequest) GraphDBService(com.runwaysdk.dataaccess.graph.GraphDBService) GraphRequest(com.runwaysdk.dataaccess.graph.GraphRequest) Request(com.runwaysdk.session.Request)

Example 3 with GraphDBService

use of com.runwaysdk.dataaccess.graph.GraphDBService in project geoprism-registry by terraframe.

the class SearchService method clear.

@Transaction
public void clear() {
    String suffix = this.getSuffix();
    MdVertexDAOIF mdVertex = MdVertexDAO.getMdVertexDAO(PACKAGE + "." + VERTEX_PREFIX + suffix);
    StringBuilder statement = new StringBuilder();
    statement.append("DELETE VERTEX " + mdVertex.getDBClassName());
    GraphDBService service = GraphDBService.getInstance();
    GraphRequest request = service.getGraphDBRequest();
    service.command(request, statement.toString(), new HashMap<>());
}
Also used : MdVertexDAOIF(com.runwaysdk.dataaccess.MdVertexDAOIF) GraphRequest(com.runwaysdk.dataaccess.graph.GraphRequest) GraphDBService(com.runwaysdk.dataaccess.graph.GraphDBService) Transaction(com.runwaysdk.dataaccess.transaction.Transaction)

Example 4 with GraphDBService

use of com.runwaysdk.dataaccess.graph.GraphDBService in project geoprism-registry by terraframe.

the class SearchService method clear.

// @Transaction
public void clear(String vertexType) {
    String suffix = this.getSuffix();
    MdVertexDAOIF mdVertex = MdVertexDAO.getMdVertexDAO(PACKAGE + "." + VERTEX_PREFIX + suffix);
    MdAttributeDAOIF mdVertexType = mdVertex.definesAttribute(VERTEX_TYPE);
    StringBuilder statement = new StringBuilder();
    statement.append("DELETE VERTEX " + mdVertex.getDBClassName());
    statement.append(" WHERE " + mdVertexType.getColumnName() + " = :vertexType");
    Map<String, Object> parameters = new HashMap<String, Object>();
    parameters.put("vertexType", vertexType);
    GraphDBService service = GraphDBService.getInstance();
    GraphRequest request = service.getGraphDBRequest();
    GraphRequest ddlRequest = service.getDDLGraphDBRequest();
    service.ddlCommand(request, ddlRequest, statement.toString(), parameters);
}
Also used : MdVertexDAOIF(com.runwaysdk.dataaccess.MdVertexDAOIF) GraphRequest(com.runwaysdk.dataaccess.graph.GraphRequest) MdAttributeDAOIF(com.runwaysdk.dataaccess.MdAttributeDAOIF) HashMap(java.util.HashMap) VertexObject(com.runwaysdk.business.graph.VertexObject) VertexServerGeoObject(net.geoprism.registry.model.graph.VertexServerGeoObject) GraphDBService(com.runwaysdk.dataaccess.graph.GraphDBService)

Example 5 with GraphDBService

use of com.runwaysdk.dataaccess.graph.GraphDBService in project geoprism-registry by terraframe.

the class VertexServerGeoObject method removeAllEdges.

public static void removeAllEdges(ServerHierarchyType hierarchyType, ServerGeoObjectType childType) {
    StringBuilder statement = new StringBuilder();
    statement.append("DELETE EDGE " + hierarchyType.getMdEdge().getDBClassName());
    statement.append(" WHERE in.@class = :class");
    statement.append(" OR out.@class = :class");
    Map<String, Object> parameters = new HashMap<String, Object>();
    parameters.put("class", childType.getMdVertex().getDBClassName());
    GraphDBService service = GraphDBService.getInstance();
    service.command(service.getGraphDBRequest(), statement.toString(), parameters);
}
Also used : HashMap(java.util.HashMap) GeoObject(org.commongeoregistry.adapter.dataaccess.GeoObject) VertexObject(com.runwaysdk.business.graph.VertexObject) EdgeObject(com.runwaysdk.business.graph.EdgeObject) AbstractServerGeoObject(net.geoprism.registry.model.AbstractServerGeoObject) GraphObject(com.runwaysdk.business.graph.GraphObject) MultiLineString(com.vividsolutions.jts.geom.MultiLineString) LineString(com.vividsolutions.jts.geom.LineString) GraphDBService(com.runwaysdk.dataaccess.graph.GraphDBService)

Aggregations

GraphDBService (com.runwaysdk.dataaccess.graph.GraphDBService)6 GraphRequest (com.runwaysdk.dataaccess.graph.GraphRequest)5 VertexObject (com.runwaysdk.business.graph.VertexObject)4 MdVertexDAOIF (com.runwaysdk.dataaccess.MdVertexDAOIF)2 GraphDDLCommandAction (com.runwaysdk.dataaccess.graph.GraphDDLCommandAction)2 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)2 HashMap (java.util.HashMap)2 VertexServerGeoObject (net.geoprism.registry.model.graph.VertexServerGeoObject)2 EdgeObject (com.runwaysdk.business.graph.EdgeObject)1 GraphObject (com.runwaysdk.business.graph.GraphObject)1 MdAttributeDAOIF (com.runwaysdk.dataaccess.MdAttributeDAOIF)1 MdAttributeDateDAO (com.runwaysdk.dataaccess.metadata.MdAttributeDateDAO)1 MdAttributeTextDAO (com.runwaysdk.dataaccess.metadata.MdAttributeTextDAO)1 MdEdgeDAO (com.runwaysdk.dataaccess.metadata.graph.MdEdgeDAO)1 MdVertexDAO (com.runwaysdk.dataaccess.metadata.graph.MdVertexDAO)1 Request (com.runwaysdk.session.Request)1 LineString (com.vividsolutions.jts.geom.LineString)1 MultiLineString (com.vividsolutions.jts.geom.MultiLineString)1 AbstractServerGeoObject (net.geoprism.registry.model.AbstractServerGeoObject)1 GeoObject (org.commongeoregistry.adapter.dataaccess.GeoObject)1