类 ClassMappingUtils

java.lang.Object
cn.featherfly.common.db.mapping.ClassMappingUtils

public class ClassMappingUtils
extends java.lang.Object

ClassMappingUtils

.
  • 构造器概要

    构造器
    构造器 说明
    ClassMappingUtils()  
  • 方法概要

    修饰符和类型 方法 说明
    static Table createTable​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect, SqlTypeMappingManager sqlTypeMappingManager)
    Gets the table model.
    static com.speedment.common.tuple.Tuple2<java.lang.String,​java.lang.String> getColumnAndPropertyName​(java.lang.String name, cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping)
    根据传入name获取对应的columnName,propertyName.
    static java.lang.String getColumnName​(java.lang.String name, cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping)
    根据传入name获取对应的columnName.
    static java.lang.String[] getColumnNames​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, java.lang.String... names)
    根据传入name获取对应的columnName array.
    static java.lang.String[] getColumnNames​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, java.util.Collection<java.lang.String> names)
    根据传入name获取对应的columnName array.
    static java.lang.String getCreateTableSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect, SqlTypeMappingManager sqlTypeMappingManager)
    Gets the creates the table sql.
    static com.speedment.common.tuple.Tuple2<java.lang.String,​java.util.Map<java.lang.Integer,​java.lang.String>> getDeleteSqlAndParamPositions​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect)
    Gets the delete sql and param positions.
    static com.speedment.common.tuple.Tuple2<java.lang.String,​java.util.Map<java.lang.Integer,​java.lang.String>> getInsertBatchSqlAndParamPositions​(int insertAmount, cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect)
    Gets the insert batch sql and param positions.
    static com.speedment.common.tuple.Tuple2<java.lang.String,​java.util.Map<java.lang.Integer,​java.lang.String>> getInsertSqlAndParamPositions​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect)
    Gets the insert sql and param positions.
    static <T> com.speedment.common.tuple.Tuple2<java.lang.String,​java.util.Map<java.lang.Integer,​java.lang.String>> getMergeSqlAndParamPositions​(T entity, cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, boolean onlyNull, Dialect dialect)
    Gets the merge sql and param positions.
    static java.lang.String getPropertyAliasName​(cn.featherfly.common.repository.mapping.PropertyMapping propertyMapping)
    Gets the property alias name.
    static java.lang.String getPropertyAliasName​(cn.featherfly.common.repository.mapping.PropertyMapping propertyMapping, Dialect dialect)
    Gets the property alias name.
    static java.lang.String getSelectByIdSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect)
    Gets the select by id sql.
    static java.lang.String getSelectByIdSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, java.lang.String alias, Dialect dialect)
    Gets the select by id sql.
    static java.util.Map<java.lang.String,​java.lang.String> getSelectColumns​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping)
    Gets the select columns.
    static java.lang.String getSelectColumnsSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, java.lang.String tableAlias, Dialect dialect)
    Gets the select columns sql.
    static java.lang.String getSelectColumnsSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, java.lang.String tableAlias, Dialect dialect, cn.featherfly.common.repository.mapping.MappingFactory mappingFactory, java.util.Map<java.lang.String,​java.lang.String> fetchProperties)
    Gets the select columns sql.
    static java.lang.String getSelectColumnsSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, java.lang.String tableAlias, java.lang.String prefixPropertyName, Dialect dialect)
    Gets the select columns sql.
    static java.lang.String getSelectSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect)
    Gets the select sql.
    static java.lang.String getSelectSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, java.lang.String alias, Dialect dialect)
    Gets the select sql.
    static com.speedment.common.tuple.Tuple2<java.lang.String,​java.util.Map<java.lang.Integer,​java.lang.String>> getUpdateSqlAndParamPositions​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect)
    Gets the update sql and param positions.

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • ClassMappingUtils

      public ClassMappingUtils()
  • 方法详细资料

    • createTable

      public static Table createTable​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect, SqlTypeMappingManager sqlTypeMappingManager)
      Gets the table model.
      参数:
      classMapping - the class mapping
      dialect - the dialect
      sqlTypeMappingManager - the sql type mapping manager
      返回:
      the table model
    • getCreateTableSql

      public static java.lang.String getCreateTableSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect, SqlTypeMappingManager sqlTypeMappingManager)
      Gets the creates the table sql.
      参数:
      classMapping - the class mapping
      dialect - the dialect
      sqlTypeMappingManager - the sql type mapping manager
      返回:
      the creates the table sql
    • getInsertBatchSqlAndParamPositions

      public static com.speedment.common.tuple.Tuple2<java.lang.String,​java.util.Map<java.lang.Integer,​java.lang.String>> getInsertBatchSqlAndParamPositions​(int insertAmount, cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect)
      Gets the insert batch sql and param positions.
      参数:
      insertAmount - the insert amount
      classMapping - the class mapping
      dialect - the dialect
      返回:
      the insert batch sql and param positions
    • getInsertSqlAndParamPositions

      public static com.speedment.common.tuple.Tuple2<java.lang.String,​java.util.Map<java.lang.Integer,​java.lang.String>> getInsertSqlAndParamPositions​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect)
      Gets the insert sql and param positions.
      参数:
      classMapping - the class mapping
      dialect - the dialect
      返回:
      the insert sql and param positions
    • getUpdateSqlAndParamPositions

      public static com.speedment.common.tuple.Tuple2<java.lang.String,​java.util.Map<java.lang.Integer,​java.lang.String>> getUpdateSqlAndParamPositions​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect)
      Gets the update sql and param positions.
      参数:
      classMapping - the class mapping
      dialect - the dialect
      返回:
      the update sql and param positions
    • getDeleteSqlAndParamPositions

      public static com.speedment.common.tuple.Tuple2<java.lang.String,​java.util.Map<java.lang.Integer,​java.lang.String>> getDeleteSqlAndParamPositions​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect)
      Gets the delete sql and param positions.
      参数:
      classMapping - the class mapping
      dialect - the dialect
      返回:
      the delete sql and param positions
    • getMergeSqlAndParamPositions

      public static <T> com.speedment.common.tuple.Tuple2<java.lang.String,​java.util.Map<java.lang.Integer,​java.lang.String>> getMergeSqlAndParamPositions​(T entity, cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, boolean onlyNull, Dialect dialect)
      Gets the merge sql and param positions.
      类型参数:
      T - the generic type
      参数:
      entity - the entity
      classMapping - the class mapping
      onlyNull - the only null
      dialect - the dialect
      返回:
      the merge sql and param positions
    • getSelectByIdSql

      public static java.lang.String getSelectByIdSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect)
      Gets the select by id sql.
      参数:
      classMapping - the class mapping
      dialect - the dialect
      返回:
      the select by id sql
    • getSelectByIdSql

      public static java.lang.String getSelectByIdSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, java.lang.String alias, Dialect dialect)
      Gets the select by id sql.
      参数:
      classMapping - the class mapping
      alias - the alias
      dialect - the dialect
      返回:
      the select by id sql
    • getSelectSql

      public static java.lang.String getSelectSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, Dialect dialect)
      Gets the select sql.
      参数:
      classMapping - the class mapping
      dialect - the dialect
      返回:
      the select sql
    • getSelectSql

      public static java.lang.String getSelectSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, java.lang.String alias, Dialect dialect)
      Gets the select sql.
      参数:
      classMapping - the class mapping
      alias - the alias
      dialect - the dialect
      返回:
      the select sql
    • getSelectColumnsSql

      public static java.lang.String getSelectColumnsSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, java.lang.String tableAlias, Dialect dialect)
      Gets the select columns sql.
      参数:
      classMapping - the class mapping
      tableAlias - the table alias
      dialect - the dialect
      返回:
      the select columns sql
    • getSelectColumnsSql

      public static java.lang.String getSelectColumnsSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, java.lang.String tableAlias, java.lang.String prefixPropertyName, Dialect dialect)
      Gets the select columns sql.
      参数:
      classMapping - the class mapping
      tableAlias - the table alias
      prefixPropertyName - the prefix property name
      dialect - the dialect
      返回:
      the select columns sql
    • getSelectColumnsSql

      public static java.lang.String getSelectColumnsSql​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, java.lang.String tableAlias, Dialect dialect, cn.featherfly.common.repository.mapping.MappingFactory mappingFactory, java.util.Map<java.lang.String,​java.lang.String> fetchProperties)
      Gets the select columns sql.
      参数:
      classMapping - the class mapping
      tableAlias - the table alias
      dialect - the dialect
      mappingFactory - the mapping factory
      fetchProperties - the fetch properties
      返回:
      the select columns sql
    • getPropertyAliasName

      public static java.lang.String getPropertyAliasName​(cn.featherfly.common.repository.mapping.PropertyMapping propertyMapping)
      Gets the property alias name.
      参数:
      propertyMapping - the property mapping
      返回:
      the property alias name
    • getPropertyAliasName

      public static java.lang.String getPropertyAliasName​(cn.featherfly.common.repository.mapping.PropertyMapping propertyMapping, Dialect dialect)
      Gets the property alias name.
      参数:
      propertyMapping - the property mapping
      dialect - the dialect
      返回:
      the property alias name
    • getSelectColumns

      public static java.util.Map<java.lang.String,​java.lang.String> getSelectColumns​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping)
      Gets the select columns.
      参数:
      classMapping - the class mapping
      返回:
      the select columns
    • getColumnAndPropertyName

      public static com.speedment.common.tuple.Tuple2<java.lang.String,​java.lang.String> getColumnAndPropertyName​(java.lang.String name, cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping)
      根据传入name获取对应的columnName,propertyName.
      参数:
      name - property name or column name
      classMapping - classMapping
      返回:
      Tuple<columnName, propertyName>
    • getColumnName

      public static java.lang.String getColumnName​(java.lang.String name, cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping)
      根据传入name获取对应的columnName.
      参数:
      name - property name or column name
      classMapping - classMapping
      返回:
      columnName
    • getColumnNames

      public static java.lang.String[] getColumnNames​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, java.lang.String... names)
      根据传入name获取对应的columnName array.
      参数:
      classMapping - classMapping
      names - property name or column name array
      返回:
      columnNames
    • getColumnNames

      public static java.lang.String[] getColumnNames​(cn.featherfly.common.repository.mapping.ClassMapping<?> classMapping, java.util.Collection<java.lang.String> names)
      根据传入name获取对应的columnName array.
      参数:
      classMapping - classMapping
      names - property name or column name collection
      返回:
      columnNames