added public isReadonly() method to check the readonly flag from

other packages.
This commit is contained in:
hns 2002-02-25 14:45:54 +00:00
parent 3fee354352
commit 4e192c39c0

View file

@ -454,7 +454,7 @@ public class Relation {
constraints[i].addToQuery (q, home, nonvirtual); constraints[i].addToQuery (q, home, nonvirtual);
prefix = " AND "; prefix = " AND ";
} }
if (filter != null) { if (filter != null) {
q.append (prefix); q.append (prefix);
q.append (filter); q.append (filter);
@ -478,6 +478,12 @@ public class Relation {
return order; 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. * Check if the child node fullfills the constraints defined by this relation.
@ -596,7 +602,7 @@ public class Relation {
foreignName = foreign; foreignName = foreign;
isGroupby = groupby; isGroupby = groupby;
} }
public void addToQuery (StringBuffer q, INode home, INode nonvirtual) { public void addToQuery (StringBuffer q, INode home, INode nonvirtual) {
String local = null; String local = null;
INode ref = isGroupby ? home : nonvirtual; INode ref = isGroupby ? home : nonvirtual;
@ -611,19 +617,19 @@ public class Relation {
q.append (escape (local)); q.append (escape (local));
q.append ("'"); q.append ("'");
} }
public boolean foreignKeyIsPrimary () { public boolean foreignKeyIsPrimary () {
return foreignName == null || foreignName.equals (otherType.getIDField ()); return foreignName == null || foreignName.equals (otherType.getIDField ());
} }
public String foreignProperty () { public String foreignProperty () {
return otherType.columnNameToProperty (foreignName); return otherType.columnNameToProperty (foreignName);
} }
public String localProperty () { public String localProperty () {
return ownType.columnNameToProperty (localName); return ownType.columnNameToProperty (localName);
} }
public String toString () { public String toString () {
return ownType+"."+localName+"="+tableName+"."+foreignName; return ownType+"."+localName+"="+tableName+"."+foreignName;
} }
@ -632,53 +638,3 @@ public class Relation {
} }