diff options
author | pfullbright | 2010-02-20 00:22:18 +0000 |
---|---|---|
committer | pfullbright | 2010-02-20 00:22:18 +0000 |
commit | 3c9773c3b3c718397306cb548f9b7e0e20599e00 (patch) | |
tree | 23646b623b157c873404a3bc6a959a589e80c974 /jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java | |
parent | fd43ffb00d089974bf131042a221730e0b817e57 (diff) | |
download | webtools.dali-3c9773c3b3c718397306cb548f9b7e0e20599e00.tar.gz webtools.dali-3c9773c3b3c718397306cb548f9b7e0e20599e00.tar.xz webtools.dali-3c9773c3b3c718397306cb548f9b7e0e20599e00.zip |
primary key validation
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java')
-rw-r--r-- | jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java index 11fae5fa89..d5d51b2426 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java @@ -255,6 +255,25 @@ public interface Entity GeneratorContainer getGeneratorContainer(); + + // **************** entity inheritance ************************************ + + /** + * Return whether this entity is a root entity in an inheritance hierarchy + */ + boolean isRoot(); + + /** + * Return the ultimate top of the inheritance hierarchy + * This method should never return null. The root + * is defined as the persistent type in the inheritance hierarchy + * that has no parent. The root should be an entity + * + * Non-entities in the hierarchy should be ignored, ie skip + * over them in the search for the root. + */ + Entity getRootEntity(); + /** * The given Entity has this entity as its root entity, add * it as a sub entity. @@ -262,6 +281,9 @@ public interface Entity */ void addSubEntity(Entity subEntity); + + // ************************************************************************ + /** * Returns the attribute mapping that matches the name. * In 2.0 this name could use dot-notation for nested mappings. @@ -269,8 +291,8 @@ public interface Entity AttributeMapping resolveAttributeMapping(String name); /** - * Return the entity's primary key attribute. - * Return null if the entity has multiple primary key attributes. + * If an entity has a single id attribute, return that attribute. + * Else return null. */ - PersistentAttribute getPrimaryKeyAttribute(); + PersistentAttribute getIdAttribute(); } |