Class TableConfig

java.lang.Object
org.nervousync.database.beans.configs.table.TableConfig
All Implemented Interfaces:
Serializable

public final class TableConfig extends Object implements Serializable
Table config
Version:
$Revision : 1.0 $ $Date: Mar 23, 2010 10:13:02 AM $
Author:
Steven Wee wmkm0113@Hotmail.com
See Also:
  • Method Details

    • lazyLoadField

      public static boolean lazyLoadField(Field field)
    • newInstance

      public static Optional<TableConfig> newInstance(Class<?> clazz)
      Generate TableConfig object by given class
      Parameters:
      clazz - Entity class define
      Returns:
      TableConfig object or null if class is invalid
    • getSerialVersionUID

      public static long getSerialVersionUID()
      Gets serial version uid.
      Returns:
      the serialVersionUID
    • getSchemaName

      public String getSchemaName()
      Gets database name.
      Returns:
      the database name
    • getTableName

      public String getTableName()
      Gets table name.
      Returns:
      the tableName
    • isCacheable

      public boolean isCacheable()
      Is cacheable boolean.
      Returns:
      the boolean
    • getDefineClass

      public Class<?> getDefineClass()
      Gets define class.
      Returns:
      the defineClass
    • getColumnConfigList

      public List<ColumnConfig> getColumnConfigList()
      Gets column config list.
      Returns:
      the columnConfigList
    • getIndexes

      public jakarta.persistence.Index[] getIndexes()
      Get indexes search index [ ].
      Returns:
      the indexes
    • getLockOption

      public LockOption getLockOption()
      Gets lock option.
      Returns:
      the lockOption
    • getDropOption

      public DropOption getDropOption()
      Gets drop option.
      Returns:
      the dropOption
    • identifyKey

      public String identifyKey(Object object)
      Identify key string.
      Parameters:
      object - the base object
      Returns:
      the string
    • identifyKey

      public String identifyKey(Object object, String itemKey)
      Identify key string.
      Parameters:
      object - the base object
      itemKey - the item key
      Returns:
      the string
    • cacheKeys

      public List<String> cacheKeys(Object object)
      Cache keys list.
      Parameters:
      object - the object
      Returns:
      the list
    • cacheKey

      public String cacheKey(Object object, String fieldName)
      Cache key string.
      Parameters:
      object - the object
      fieldName - the field name
      Returns:
      the string
    • cacheKey

      public String cacheKey(SortedMap<String,Object> primaryKey)
    • verify

      public void verify(Object object, long identifyCode) throws DataModifiedException
      Verify.
      Parameters:
      object - the object
      identifyCode - identify code
      Throws:
      DataModifiedException - the data modified exception
    • columnName

      public String columnName(String identifyName)
      Column name string.
      Parameters:
      identifyName - column identify name
      Returns:
      the string
    • isColumn

      public boolean isColumn(String identifyName)
      Check given identifyName is a column
      Parameters:
      identifyName - maybe is field name or column name
      Returns:
      check result
    • isLazyLoad

      public boolean isLazyLoad(String identifyName)
      Check given identifyName is a lazy load column
      Parameters:
      identifyName - maybe is field name or column name
      Returns:
      check result
    • getColumnConfig

      public ColumnConfig getColumnConfig(String identifyName)
      Retrieve column config by given identifyName
      Parameters:
      identifyName - maybe is field name or column name
      Returns:
      Retrieve column config, or null if not found
    • identifyVersionColumn

      public Optional<ColumnConfig> identifyVersionColumn()
      Retrieve identified version column config
      Returns:
      Retrieve column config, or null if not defined
    • findReferenceConfig

      public ReferenceConfig findReferenceConfig(String identifyName)
      Retrieve reference config by given field name
      Parameters:
      identifyName - Reference column identify name, maybe field name or reference entity class name
      Returns:
      Retrieve ReferenceConfig object, or null if not found
    • referenceIterator

      public Iterator<ReferenceConfig> referenceIterator()
      Iterator reference config
      Returns:
      Reference Iterator
      See Also:
    • generatePrimaryKey

      public void generatePrimaryKey(Object object)
      Generate primary key value
      Parameters:
      object - the object
    • generatePrimaryKeyMap

      public SortedMap<String,Object> generatePrimaryKeyMap(Object object)
      Generate primary key column parameter map
      Parameters:
      object - the object
      Returns:
      Primary key map
    • generatePrimaryKeyMap

      public SortedMap<String,Object> generatePrimaryKeyMap(Object object, boolean forUpdate)
      Generate primary key column parameter map
      Parameters:
      object - the object
      forUpdate - the for update
      Returns:
      Primary key map
    • convertToDataMap

      public SortedMap<String,Object> convertToDataMap(Object object, Converter converter)
      Generate primary key columns and normal column parameter map
      Parameters:
      object - the object
      converter - the converter
      Returns:
      Data map
    • convertToUpdateMap

      public SortedMap<String,Object> convertToUpdateMap(Object object, Converter converter)
      Generate primary key columns and normal column parameter map
      Parameters:
      object - the object
      converter - the converter
      Returns:
      Data map
    • retrieveValue

      public Object retrieveValue(Object object, String identifyKey)
      Retrieve value optional.
      Parameters:
      object - the object
      identifyKey - the identify key
      Returns:
      the optional