# HG changeset patch # User casties # Date 1486033103 -3600 # Node ID b5a22b9ab9c6c82edcec271d7e460898e887a3ba # Parent bde6212babfda69ce5e7aa560bcce5c781339d20 Relation constructor takes objectClass instead of ownValue. diff -r bde6212babfd -r b5a22b9ab9c6 src/main/java/org/mpi/openmind/repository/bo/Relation.java --- a/src/main/java/org/mpi/openmind/repository/bo/Relation.java Wed Feb 01 19:54:12 2017 +0100 +++ b/src/main/java/org/mpi/openmind/repository/bo/Relation.java Thu Feb 02 11:58:23 2017 +0100 @@ -71,6 +71,16 @@ return rel; } + /** + * Creates a Relation with the given source and target Entities. + * + * Adds the Relation to the Entities. Requires Entities to be non-lightweight. + * + * Make sure to set objectClass later. + * + * @param source + * @param target + */ public Relation(Entity source, Entity target){ this.setSource(source); this.setTarget(target); @@ -79,12 +89,22 @@ this.setSystemStatus(Node.SYS_STATUS_CURRENT_VERSION); } - public Relation(Entity srcNonLW, Entity tarNonLW, String ownValue){ + /** + * Creates a Relation with the given source and target Entities and objectClass. + * + * Adds the Relation to the Entities. Requires Entities to be non-lightweight. + * + * @param srcNonLW + * @param tarNonLW + * @param objectClass + */ + public Relation(Entity srcNonLW, Entity tarNonLW, String objectClass){ this.setSource(srcNonLW); this.setTarget(tarNonLW); srcNonLW.addSourceRelation(this); tarNonLW.addTargetRelation(this); - this.setOwnValue(ownValue); + this.setObjectClass(objectClass); + this.setOwnValue(objectClass); this.setSystemStatus(Node.SYS_STATUS_CURRENT_VERSION); }