jodd.db.orm
Class DbMetaUtil

java.lang.Object
  extended by jodd.db.orm.DbMetaUtil

public class DbMetaUtil
extends java.lang.Object

Few meta resolving utils.


Constructor Summary
DbMetaUtil()
           
 
Method Summary
static void resolveColumnDbSqlType(java.sql.Connection connection, DbEntityColumnDescriptor dec)
          Resolves column db sql type and populates it in column descriptor if missing.
static DbEntityColumnDescriptor resolveColumnDescriptors(DbEntityDescriptor ded, java.lang.reflect.Field field, boolean isAnnotated, boolean toUpperCase)
          Resolves column descriptor from field.
static boolean resolveIsAnnotated(java.lang.Class<?> type)
           
static java.lang.String resolveSchemaName(java.lang.Class<?> type, java.lang.String defaultSchemaName)
          Resolves schema name.
static java.lang.String resolveTableName(java.lang.Class<?> type, java.lang.String tableNamePrefix, java.lang.String tableNameSuffix, boolean toUpperCase)
          Resolves table name from a type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbMetaUtil

public DbMetaUtil()
Method Detail

resolveTableName

public static java.lang.String resolveTableName(java.lang.Class<?> type,
                                                java.lang.String tableNamePrefix,
                                                java.lang.String tableNameSuffix,
                                                boolean toUpperCase)
Resolves table name from a type. If type is annotated, table name will be read from annotation value. If this value is empty or if type is not annotated, table name will be set to wildcard pattern '*' (to match all tables).


resolveSchemaName

public static java.lang.String resolveSchemaName(java.lang.Class<?> type,
                                                 java.lang.String defaultSchemaName)
Resolves schema name. Uses default schema name if not specified.


resolveIsAnnotated

public static boolean resolveIsAnnotated(java.lang.Class<?> type)

resolveColumnDescriptors

public static DbEntityColumnDescriptor resolveColumnDescriptors(DbEntityDescriptor ded,
                                                                java.lang.reflect.Field field,
                                                                boolean isAnnotated,
                                                                boolean toUpperCase)
Resolves column descriptor from field. If field is annotated value will be read from annotation. If field is not annotated, then field will be ignored if entity is annotated. Otherwise, column name is generated from the field name.


resolveColumnDbSqlType

public static void resolveColumnDbSqlType(java.sql.Connection connection,
                                          DbEntityColumnDescriptor dec)
Resolves column db sql type and populates it in column descriptor if missing.



Copyright © 2003-2010 Jodd Team