Mercurial > hg > openmind
diff src/main/java/org/mpi/openmind/repository/bo/Relation.java @ 70:b5a22b9ab9c6
Relation constructor takes objectClass instead of ownValue.
author | casties |
---|---|
date | Thu, 02 Feb 2017 11:58:23 +0100 |
parents | 467843399e70 |
children |
line wrap: on
line diff
--- 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); }