Class EclibEntity

java.lang.Object
jp.ecuacion.lib.jpa.entity.EclibEntity

public abstract class EclibEntity extends Object
Provides the customized jpa entity.
  • Constructor Details

    • EclibEntity

      public EclibEntity()
  • Method Details

    • getValue

      @Nullable public Object getValue(@RequireNonnull String fieldName)
      Returns the value of the designated fieldName.
      Parameters:
      fieldName - fieldName. Cannot be null.
      Returns:
      value. May be null when the value is null.
    • getPkFieldName

      @Nonnull public String getPkFieldName()
      Returns the surrogate-key field name, to which '@Id' is added.
      Returns:
      surrogate key field name.
    • getAutoIncrementFieldNameSet

      @Nonnull public Set<String> getAutoIncrementFieldNameSet()
      Returns the auto-increment field name, to which '@GeneratedValue' is added.
      Returns:
      auto-increment field name.
    • isAutoIncrement

      public boolean isAutoIncrement(@RequireNonnull String fieldName)
      Returns if the designated field is auto-increment.
      Parameters:
      fieldName - fieldName.
      Returns:
      field is auto-increment
    • getSetOfUniqueConstraintFieldList

      @Nonnull public Set<List<String>> 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

      public abstract String[] getFieldNameArr()
      Returns field name array.
      Returns:
      field name array.