From 45d32cc2da08ffb66a808cd7cf45d404bc23f47a Mon Sep 17 00:00:00 2001 From: hns Date: Fri, 24 Oct 2003 15:35:31 +0000 Subject: [PATCH] Added a comment that tries to make clear the difference between isVirtual() and isCollection() --- src/helma/objectmodel/db/Relation.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/helma/objectmodel/db/Relation.java b/src/helma/objectmodel/db/Relation.java index 220de6a8..0ddb0ebd 100644 --- a/src/helma/objectmodel/db/Relation.java +++ b/src/helma/objectmodel/db/Relation.java @@ -350,7 +350,7 @@ public final class Relation { cnst.addElement(new Constraint(local, foreign, false)); } } - + // parse constraints logic if (cnst.size() > 1) { String logic = props.getProperty(propName + ".logicalOperator"); @@ -366,7 +366,7 @@ public final class Relation { } else { logicalOperator = AND; } - + } /////////////////////////////////////////////////////////////////////////////////////////// @@ -393,7 +393,11 @@ public final class Relation { } /** - * Returns true if this Relation describes a collection object property + * Returns true if this Relation describes a collection. + * NOTE: this will return true both for collection objects + * (aka virtual nodes) and direct child object relations, so + * isVirtual() should be used to identify relations that define + * collection properties! */ public boolean isCollection() { return reftype == COLLECTION; @@ -443,7 +447,7 @@ public final class Relation { if (otherType == null) { return false; } - + return virtual || (otherType.isRelational() && accessName != null) || (groupby != null) || isComplexReference(); @@ -872,7 +876,7 @@ public final class Relation { } q.append(')'); } - + /** * * @@ -896,7 +900,7 @@ public final class Relation { if (filter != null) { appendFilter(q, nonvirtual, prefix); } - + return q.toString(); }