implemented isInstanceOf to tell whether
a DbMapping represents itself or by inheritance some prototype.
This commit is contained in:
parent
ce781df919
commit
cdf170c568
1 changed files with 15 additions and 0 deletions
|
@ -670,6 +670,21 @@ public class DbMapping implements Updatable {
|
||||||
return !other.isRelational ();
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue