# HG changeset patch # User Robert Casties # Date 1541772737 -3600 # Node ID 68e759210b535d2955b819df913dc26c8a481db2 # Parent c418851eeb86c709607c3c09774afd098e77f4b1 add option in getSource/TargetRelations() to match all object classes with "*". diff -r c418851eeb86 -r 68e759210b53 src/main/java/org/mpi/openmind/repository/bo/Entity.java --- a/src/main/java/org/mpi/openmind/repository/bo/Entity.java Fri Nov 09 13:53:27 2018 +0100 +++ b/src/main/java/org/mpi/openmind/repository/bo/Entity.java Fri Nov 09 15:12:17 2018 +0100 @@ -178,6 +178,8 @@ /** * Returns a list of source Relations of this Entity with the given relation name and target object class. * + * tarObjClass="*" accepts all target objects. + * * @param relationName * @param tarObjClass * @return @@ -189,8 +191,10 @@ 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.getOwnValue().equals(relationName) && relation.getTargetObjectClass().equals(tarObjClass)) { - list.add(relation); + if (relation.getObjectClass().equals(relationName)) { + if (tarObjClass.equals("*") || relation.getTargetObjectClass().equals(tarObjClass)) { + list.add(relation); + } } } } catch (Exception e) { @@ -202,6 +206,8 @@ /** * Returns a list of target Relations of this Entity with the given relation name and source object class. * + * srcObjClass="*" accepts all source objects. + * * @param relationName * @param srcObjClass * @return @@ -213,8 +219,10 @@ 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.getOwnValue().equals(relationName) && relation.getSourceObjectClass().equals(srcObjClass)) { - list.add(relation); + if (relation.getObjectClass().equals(relationName)) { + if (srcObjClass.equals("*") || relation.getSourceObjectClass().equals(srcObjClass)) { + list.add(relation); + } } } } catch (Exception e) {