# HG changeset patch # User Robert Casties # Date 1545329745 -3600 # Node ID 8ce343218005e3f8729dd639492ac9153fad6cf5 # Parent 1149eb948036073ba4359e5b3d5b784637df8b22 add wildcard for relation name in Entity.getSource/TargetRelations(). diff -r 1149eb948036 -r 8ce343218005 src/main/java/org/mpi/openmind/repository/bo/Entity.java --- a/src/main/java/org/mpi/openmind/repository/bo/Entity.java Wed Nov 14 18:31:55 2018 +0100 +++ b/src/main/java/org/mpi/openmind/repository/bo/Entity.java Thu Dec 20 19:15:45 2018 +0100 @@ -177,7 +177,7 @@ /** * Returns a list of source Relations of this Entity with the given relation name and target object class. - * + * relationName="*" accepts all relations. * tarObjClass="*" accepts all target objects. * * @param relationName @@ -191,7 +191,7 @@ throw new IllegalAccessException("This Entity is lightweight, so its relations and attributes were not loaded from the DB."); } for (Relation relation : this.getSourceRelations()) { - if (relation.getObjectClass().equals(relationName)) { + if (relationName.equals("*") || relation.getObjectClass().equals(relationName)) { if (tarObjClass.equals("*") || relation.getTargetObjectClass().equals(tarObjClass)) { list.add(relation); } @@ -205,7 +205,7 @@ /** * Returns a list of target Relations of this Entity with the given relation name and source object class. - * + * relationName="*" accepts all relations. * srcObjClass="*" accepts all source objects. * * @param relationName @@ -219,7 +219,7 @@ throw new IllegalAccessException("This Entity is lightweight, so its relations and attributes were not loaded from the DB."); } for (Relation relation : this.getTargetRelations()) { - if (relation.getObjectClass().equals(relationName)) { + if (relationName.equals("*") || relation.getObjectClass().equals(relationName)) { if (srcObjClass.equals("*") || relation.getSourceObjectClass().equals(srcObjClass)) { list.add(relation); }