public class SecondaryKeyMetadata extends FieldMetadata
SecondaryKey annotation.
SecondaryKeyMetadata objects are thread-safe. Multiple threads
may safely call the methods of a shared SecondaryKeyMetadata
object.
| Constructor and Description |
|---|
SecondaryKeyMetadata(String name,
String className,
String declaringClassName,
String elementClassName,
String keyName,
Relationship relationship,
String relatedEntity,
DeleteAction deleteAction)
Used by an
EntityModel to construct secondary key metadata. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other) |
DeleteAction |
getDeleteAction()
Returns the action to take when a related entity is deleted having a
primary key value that exists as a secondary key value for this entity.
|
String |
getElementClassName()
Returns the class name of the array or collection element for a
ONE_TO_MANY or MANY_TO_MANY relationship, or null for a
Relationship#ONE_TO_ONE ONE_TO_ONE} or MANY_TO_ONE relationship. |
String |
getKeyName()
Returns the key name, which may be different from the field name.
|
String |
getRelatedEntity()
Returns the class name of the related (foreign) entity, for which
foreign key constraints are specified using the
SecondaryKey.relatedEntity() annotation. |
Relationship |
getRelationship()
Returns the relationship between instances of the entity class and the
secondary keys.
|
int |
hashCode() |
getClassName, getDeclaringClassName, getName, toStringpublic SecondaryKeyMetadata(String name, String className, String declaringClassName, String elementClassName, String keyName, Relationship relationship, String relatedEntity, DeleteAction deleteAction)
EntityModel to construct secondary key metadata.name - the field name.className - the class name.declaringClassName - the name of the class where the field is
declared.elementClassName - the element class name.keyName - the key name.relationship - the Relationship.relatedEntity - the class name of the related (foreign) entity.deleteAction - the DeleteAction.public String getElementClassName()
ONE_TO_MANY or MANY_TO_MANY relationship, or null for a
Relationship#ONE_TO_ONE ONE_TO_ONE} or MANY_TO_ONE relationship.public String getKeyName()
public Relationship getRelationship()
SecondaryKey.relate() annotation.public String getRelatedEntity()
SecondaryKey.relatedEntity() annotation.public DeleteAction getDeleteAction()
SecondaryKey.onRelatedEntityDelete() annotation.public boolean equals(Object other)
equals in class FieldMetadatapublic int hashCode()
hashCode in class FieldMetadataCopyright © 2024. All rights reserved.