Package com.sleepycat.persist.model
Class SecondaryKeyMetadata
java.lang.Object
com.sleepycat.persist.model.FieldMetadata
com.sleepycat.persist.model.SecondaryKeyMetadata
- All Implemented Interfaces:
Serializable
The metadata for a secondary key field. A secondary key may be specified
with the
SecondaryKey annotation.
SecondaryKeyMetadata objects are thread-safe. Multiple threads
may safely call the methods of a shared SecondaryKeyMetadata
object.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSecondaryKeyMetadata(String name, String className, String declaringClassName, String elementClassName, String keyName, Relationship relationship, String relatedEntity, DeleteAction deleteAction) Used by anEntityModelto construct secondary key metadata. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns 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.Returns the class name of the array or collection element for aONE_TO_MANYorMANY_TO_MANYrelationship, or null for a Relationship#ONE_TO_ONE ONE_TO_ONE} orMANY_TO_ONErelationship.Returns the key name, which may be different from the field name.Returns the class name of the related (foreign) entity, for which foreign key constraints are specified using theSecondaryKey.relatedEntity()annotation.Returns the relationship between instances of the entity class and the secondary keys.inthashCode()Methods inherited from class com.sleepycat.persist.model.FieldMetadata
getClassName, getDeclaringClassName, getName, toString
-
Constructor Details
-
SecondaryKeyMetadata
public SecondaryKeyMetadata(String name, String className, String declaringClassName, String elementClassName, String keyName, Relationship relationship, String relatedEntity, DeleteAction deleteAction) Used by anEntityModelto construct secondary key metadata.
-
-
Method Details
-
getElementClassName
Returns the class name of the array or collection element for aONE_TO_MANYorMANY_TO_MANYrelationship, or null for a Relationship#ONE_TO_ONE ONE_TO_ONE} orMANY_TO_ONErelationship. -
getKeyName
Returns the key name, which may be different from the field name. -
getRelationship
Returns the relationship between instances of the entity class and the secondary keys. This may be specified using theSecondaryKey.relate()annotation. -
getRelatedEntity
Returns the class name of the related (foreign) entity, for which foreign key constraints are specified using theSecondaryKey.relatedEntity()annotation. -
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. This may be specified using theSecondaryKey.onRelatedEntityDelete()annotation. -
equals
- Overrides:
equalsin classFieldMetadata
-
hashCode
public int hashCode()- Overrides:
hashCodein classFieldMetadata
-