java.lang.Object
jp.ecuacion.lib.jpa.entity.AbstractEntity
Provides the customized jpa entity.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the auto-increment field name, to which '@GeneratedValue' is added.abstract String[]Returns field name array.Returns the surrogate-key field name, to which '@Id' is added.Returns an array of fields which constructs an unique Constraint connected to natural key.Returns the value of the designated fieldName.booleanReturns if the entity has natural keys.abstract booleanReturns if the entity has soft-delete field.booleanisAutoIncrement(String fieldName) Returns if the designated field is auto-increment.abstract voidProvides preInsert procedure.abstract voidProvides preUpdate procedure.
-
Constructor Details
-
AbstractEntity
public AbstractEntity()
-
-
Method Details
-
getValue
Returns the value of the designated fieldName.- Parameters:
fieldName- fieldName. Cannot benull.- Returns:
- value. May be null when the value is null.
-
getPkFieldName
Returns the surrogate-key field name, to which '@Id' is added.- Returns:
- surrogate key field name.
-
getAutoIncrementFieldNameSet
Returns the auto-increment field name, to which '@GeneratedValue' is added.- Returns:
- auto-increment field name.
-
isAutoIncrement
Returns if the designated field is auto-increment.- Parameters:
fieldName- fieldName.- Returns:
- field is auto-increment
-
getSetOfUniqueConstraintFieldList
Returns an array of fields which constructs an unique Constraint connected to natural key.- Returns:
- set of unique constraint column list.
-
hasNaturalKey
public boolean hasNaturalKey()Returns if the entity has natural keys.- Returns:
- has natural keys.
-
preInsert
public abstract void preInsert()Provides preInsert procedure.When you use spring framework, this won't be used.
-
preUpdate
public abstract void preUpdate()Provides preUpdate procedure.When you use spring framework, this won't be used.
-
hasSoftDeleteField
public abstract boolean hasSoftDeleteField()Returns if the entity has soft-delete field.- Returns:
- has soft-delete field.
-
getFieldNameArr
Returns field name array.- Returns:
- field name array.
-