implemented isInstanceOf to tell whether

a DbMapping represents itself or by inheritance
some prototype.
This commit is contained in:
hns 2001-10-01 09:54:49 +00:00
parent ce781df919
commit cdf170c568

View file

@ -670,6 +670,21 @@ public class DbMapping implements Updatable {
return !other.isRelational ();
}
/**
* Return true if this db mapping represents the prototype indicated
* by the string argument, either itself or via one of its parent prototypes.
*/
public boolean isInstanceOf (String other) {
if (typename.equals (other))
return true;
DbMapping p = parentMapping;
while (p != null) {
if (p.typename.equals (other))
return true;
p = p.parentMapping;
}
return false;
}
}