/** * Return the table for the given field, or null if no table given. */ public Table getTable(final FieldMapping field, boolean create, boolean adapt) { if (_tableName == null && !create) return null; Table table = field.getDefiningMapping().getTable(); String schemaName = (table == null) ? null : table.getSchema().getName(); // if we have no join columns defined, there may be class-level join // information with a more fully-qualified name for our table String tableName = _tableName; if (tableName != null && getColumns().isEmpty()) tableName = field.getDefiningMapping().getMappingInfo(). getSecondaryTableName(tableName); return createTable(field, new TableDefaults() { public String get(Schema schema) { // delay this so that we don't do schema reflection for unique // table name unless necessary return field.getMappingRepository().getMappingDefaults(). getTableName(field, schema); } }, schemaName, tableName, adapt); }
/** * Return the table for the given field, or null if no table given. */ public Table getTable(final FieldMapping field, boolean create, boolean adapt) { if (DBIdentifier.isNull(_tableName) && !create) return null; Table table = field.getDefiningMapping().getTable(); DBIdentifier schemaName = (table == null) ? DBIdentifier.NULL : table.getSchema().getIdentifier(); // if we have no join columns defined, there may be class-level join // information with a more fully-qualified name for our table DBIdentifier tableName = _tableName; if (!DBIdentifier.isNull(tableName) && getColumns().isEmpty()) tableName = field.getDefiningMapping().getMappingInfo(). getSecondaryTableIdentifier(tableName); return createTable(field, new TableDefaults() { public String get(Schema schema) { // delay this so that we don't do schema reflection for unique // table name unless necessary return field.getMappingRepository().getMappingDefaults(). getTableName(field, schema); } public DBIdentifier getIdentifier(Schema schema) { return field.getMappingRepository().getMappingDefaults(). getTableIdentifier(field, schema); } }, schemaName, tableName, adapt); }
/** * Return the table for the given field, or null if no table given. */ public Table getTable(final FieldMapping field, boolean create, boolean adapt) { if (DBIdentifier.isNull(_tableName) && !create) return null; Table table = field.getDefiningMapping().getTable(); DBIdentifier schemaName = (table == null) ? DBIdentifier.NULL : table.getSchema().getIdentifier(); // if we have no join columns defined, there may be class-level join // information with a more fully-qualified name for our table DBIdentifier tableName = _tableName; if (!DBIdentifier.isNull(tableName) && getColumns().isEmpty()) tableName = field.getDefiningMapping().getMappingInfo(). getSecondaryTableIdentifier(tableName); return createTable(field, new TableDefaults() { public String get(Schema schema) { // delay this so that we don't do schema reflection for unique // table name unless necessary return field.getMappingRepository().getMappingDefaults(). getTableName(field, schema); } public DBIdentifier getIdentifier(Schema schema) { return field.getMappingRepository().getMappingDefaults(). getTableIdentifier(field, schema); } }, schemaName, tableName, adapt); }
/** * Return the table for the given field, or null if no table given. */ public Table getTable(final FieldMapping field, boolean create, boolean adapt) { if (DBIdentifier.isNull(_tableName) && !create) return null; Table table = field.getDefiningMapping().getTable(); DBIdentifier schemaName = (table == null) ? DBIdentifier.NULL : table.getSchema().getIdentifier(); // if we have no join columns defined, there may be class-level join // information with a more fully-qualified name for our table DBIdentifier tableName = _tableName; if (!DBIdentifier.isNull(tableName) && getColumns().isEmpty()) tableName = field.getDefiningMapping().getMappingInfo(). getSecondaryTableIdentifier(tableName); return createTable(field, new TableDefaults() { public String get(Schema schema) { // delay this so that we don't do schema reflection for unique // table name unless necessary return field.getMappingRepository().getMappingDefaults(). getTableName(field, schema); } public DBIdentifier getIdentifier(Schema schema) { // TODO Auto-generated method stub return field.getMappingRepository().getMappingDefaults(). getTableIdentifier(field, schema); } }, schemaName, tableName, adapt); }
/** * Return the table for the given field, or null if no table given. */ public Table getTable(final FieldMapping field, boolean create, boolean adapt) { if (DBIdentifier.isNull(_tableName) && !create) return null; Table table = field.getDefiningMapping().getTable(); DBIdentifier schemaName = (table == null) ? DBIdentifier.NULL : table.getSchema().getIdentifier(); // if we have no join columns defined, there may be class-level join // information with a more fully-qualified name for our table DBIdentifier tableName = _tableName; if (!DBIdentifier.isNull(tableName) && getColumns().isEmpty()) tableName = field.getDefiningMapping().getMappingInfo(). getSecondaryTableIdentifier(tableName); return createTable(field, new TableDefaults() { public String get(Schema schema) { // delay this so that we don't do schema reflection for unique // table name unless necessary return field.getMappingRepository().getMappingDefaults(). getTableName(field, schema); } public DBIdentifier getIdentifier(Schema schema) { // TODO Auto-generated method stub return field.getMappingRepository().getMappingDefaults(). getTableIdentifier(field, schema); } }, schemaName, tableName, adapt); }