Search in sources :

Example 6 with DeletedBeanException

use of org.jowidgets.cap.common.api.exception.DeletedBeanException in project jo-client-platform by jo-source.

the class RelationshipBean method setEndNodeId.

protected void setEndNodeId(final Object beanTypeId, final RelationshipType relationshipType, final Object relationBeanTypeId, final Object id) {
    Assert.paramNotNull(beanTypeId, "beanTypeId");
    Assert.paramNotNull(relationshipType, "relationshipType");
    Assert.paramNotNull(id, "id");
    final Node endNode = NodeAccess.findNode(beanTypeId, id);
    if (endNode == null) {
        throw new DeletedBeanException(id);
    }
    final Node startNode = getStartNode();
    if (startNode != null) {
        createRelationship(relationBeanTypeId, relationshipType, startNode, endNode);
        tempStartNode = null;
        tempEndNode = null;
    } else {
        tempEndNode = endNode;
    }
}
Also used : DeletedBeanException(org.jowidgets.cap.common.api.exception.DeletedBeanException) Node(org.neo4j.graphdb.Node)

Aggregations

DeletedBeanException (org.jowidgets.cap.common.api.exception.DeletedBeanException)6 IBeanKey (org.jowidgets.cap.common.api.bean.IBeanKey)4 BeanException (org.jowidgets.cap.common.api.exception.BeanException)2 StaleBeanException (org.jowidgets.cap.common.api.exception.StaleBeanException)2 Node (org.neo4j.graphdb.Node)2 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 IBean (org.jowidgets.cap.common.api.bean.IBean)1 IBeanDto (org.jowidgets.cap.common.api.bean.IBeanDto)1