DbMetaUtil.resolveColumnDescriptors(this, propertyDescriptor, isAnnotated, columnNamingStrategy);
public DbEntityDescriptor( final Class<E> type, final String schemaName, final TableNamingStrategy tableNamingStrategy, final ColumnNamingStrategy columnNamingStrategy) { this.type = type; this.entityName = type.getSimpleName(); this.isAnnotated = DbMetaUtil.resolveIsAnnotated(type); this.schemaName = DbMetaUtil.resolveSchemaName(type, schemaName); this.columnNamingStrategy = columnNamingStrategy; this.mappedTypes = DbMetaUtil.resolveMappedTypes(type); this.tableNameForQuery = DbMetaUtil.resolveTableName(type, tableNamingStrategy); if (StringUtil.detectQuoteChar(tableNameForQuery) != 0) { this.tableName = StringUtil.substring(tableNameForQuery, 1, -1); } else { this.tableName = tableNameForQuery; } }
/** * 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). */ public static String resolveTableName(final Class<?> type, final TableNamingStrategy tableNamingStrategy) { String tableName = null; final DbTable dbTable = type.getAnnotation(DbTable.class); if (dbTable != null) { tableName = dbTable.value().trim(); } if ((tableName == null) || (tableName.length() == 0)) { tableName = tableNamingStrategy.convertEntityNameToTableName(type); } else { if (!tableNamingStrategy.isStrictAnnotationNames()) { tableName = tableNamingStrategy.applyToTableName(tableName); } } return quoteIfRequired(tableName, tableNamingStrategy.isAlwaysQuoteNames(), tableNamingStrategy.getQuoteChar()); }
public DbEntityDescriptor(Class type, String schemaName, TableNamingStrategy tableNamingStrategy, ColumnNamingStrategy columnNamingStrategy, boolean strictCompare) { this.type = type; this.entityName = type.getSimpleName(); this.isAnnotated = DbMetaUtil.resolveIsAnnotated(type); this.schemaName = DbMetaUtil.resolveSchemaName(type, schemaName); this.tableName = DbMetaUtil.resolveTableName(type, tableNamingStrategy); this.columnNamingStrategy = columnNamingStrategy; this.strictCompare = strictCompare; }
public DbEntityDescriptor( final Class<E> type, final String schemaName, final TableNamingStrategy tableNamingStrategy, final ColumnNamingStrategy columnNamingStrategy) { this.type = type; this.entityName = type.getSimpleName(); this.isAnnotated = DbMetaUtil.resolveIsAnnotated(type); this.schemaName = DbMetaUtil.resolveSchemaName(type, schemaName); this.columnNamingStrategy = columnNamingStrategy; this.mappedTypes = DbMetaUtil.resolveMappedTypes(type); this.tableNameForQuery = DbMetaUtil.resolveTableName(type, tableNamingStrategy); if (StringUtil.detectQuoteChar(tableNameForQuery) != 0) { this.tableName = StringUtil.substring(tableNameForQuery, 1, -1); } else { this.tableName = tableNameForQuery; } }
int idcount = 0; for (Field field : fields) { DbEntityColumnDescriptor dec = DbMetaUtil.resolveColumnDescriptors(this, field, isAnnotated, columnNamingStrategy); if (dec != null) { decList.add(dec);
quoteIfRequired(columnName, columnNamingStrategy.isAlwaysQuoteNames(), columnNamingStrategy.getQuoteChar()), property.getName(), property.getType(),
DbMetaUtil.resolveColumnDescriptors(this, propertyDescriptor, isAnnotated, columnNamingStrategy);
/** * 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). */ public static String resolveTableName(final Class<?> type, final TableNamingStrategy tableNamingStrategy) { String tableName = null; final DbTable dbTable = type.getAnnotation(DbTable.class); if (dbTable != null) { tableName = dbTable.value().trim(); } if ((tableName == null) || (tableName.length() == 0)) { tableName = tableNamingStrategy.convertEntityNameToTableName(type); } else { if (!tableNamingStrategy.isStrictAnnotationNames()) { tableName = tableNamingStrategy.applyToTableName(tableName); } } return quoteIfRequired(tableName, tableNamingStrategy.isAlwaysQuoteNames(), tableNamingStrategy.getQuoteChar()); }
quoteIfRequired(columnName, columnNamingStrategy.isAlwaysQuoteNames(), columnNamingStrategy.getQuoteChar()), property.getName(), property.getType(),