From 4e192c39c015603e867424723866f42c6a65c809 Mon Sep 17 00:00:00 2001 From: hns Date: Mon, 25 Feb 2002 14:45:54 +0000 Subject: [PATCH] added public isReadonly() method to check the readonly flag from other packages. --- src/helma/objectmodel/db/Relation.java | 68 +++++--------------------- 1 file changed, 12 insertions(+), 56 deletions(-) diff --git a/src/helma/objectmodel/db/Relation.java b/src/helma/objectmodel/db/Relation.java index ad4ac2b8..7bd5a090 100644 --- a/src/helma/objectmodel/db/Relation.java +++ b/src/helma/objectmodel/db/Relation.java @@ -454,7 +454,7 @@ public class Relation { constraints[i].addToQuery (q, home, nonvirtual); prefix = " AND "; } - + if (filter != null) { q.append (prefix); q.append (filter); @@ -478,6 +478,12 @@ public class Relation { return order; } + /** + * Tell wether the property described by this relation is to be handled as readonly/write protected. + */ + public boolean isReadonly () { + return readonly; + } /** * Check if the child node fullfills the constraints defined by this relation. @@ -596,7 +602,7 @@ public class Relation { foreignName = foreign; isGroupby = groupby; } - + public void addToQuery (StringBuffer q, INode home, INode nonvirtual) { String local = null; INode ref = isGroupby ? home : nonvirtual; @@ -611,19 +617,19 @@ public class Relation { q.append (escape (local)); q.append ("'"); } - + public boolean foreignKeyIsPrimary () { return foreignName == null || foreignName.equals (otherType.getIDField ()); } - + public String foreignProperty () { return otherType.columnNameToProperty (foreignName); } - + public String localProperty () { return ownType.columnNameToProperty (localName); } - + public String toString () { return ownType+"."+localName+"="+tableName+"."+foreignName; } @@ -632,53 +638,3 @@ public class Relation { } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -