public void setSchema(String schema) { // If the schema name is empty, check to see if a system // level default exists and if so use it. if (schema == null || "".equals(schema)){ String tmp = getRepository().getMetaDataFactory().getDefaults().getDefaultSchema(); schema = (tmp != null ? tmp : ""); } this._schema = schema; }
public void setSchema(String schema) { // If the schema name is empty, check to see if a system // level default exists and if so use it. if (schema == null || "".equals(schema)){ String tmp = getRepository().getMetaDataFactory().getDefaults().getDefaultSchema(); schema = (tmp != null ? tmp : ""); } this._schema = schema; }
/** * Return the named table for the given class. */ public Table getTable(final ClassMapping cls, DBIdentifier tableName, boolean adapt) { // If the schemaName is NULL type then check for a system default schema name // and if available use it. if (_schemaName != null && _schemaName.getType() == DBIdentifierType.NULL){ String name = cls.getMappingRepository().getMetaDataFactory().getDefaults().getDefaultSchema(); _schemaName = (name != null ? DBIdentifier.newSchema(name) : _schemaName); } Table t = createTable(cls, new TableDefaults() { public String get(Schema schema) { // delay this so that we don't do schema reflection for unique // table name unless necessary return cls.getMappingRepository().getMappingDefaults(). getTableName(cls, schema); } public DBIdentifier getIdentifier(Schema schema) { return cls.getMappingRepository().getMappingDefaults(). getTableIdentifier(cls, schema); } }, _schemaName, tableName, adapt); t.setComment(cls.getTypeAlias() == null ? cls.getDescribedType().getName() : cls.getTypeAlias()); return t; }
/** * Return the named table for the given class. */ public Table getTable(final ClassMapping cls, DBIdentifier tableName, boolean adapt) { // If the schemaName is NULL type then check for a system default schema name // and if available use it. if (_schemaName != null && _schemaName.getType() == DBIdentifierType.NULL){ String name = cls.getMappingRepository().getMetaDataFactory().getDefaults().getDefaultSchema(); _schemaName = (name != null ? DBIdentifier.newSchema(name) : _schemaName); } Table t = createTable(cls, new TableDefaults() { public String get(Schema schema) { // delay this so that we don't do schema reflection for unique // table name unless necessary return cls.getMappingRepository().getMappingDefaults(). getTableName(cls, schema); } public DBIdentifier getIdentifier(Schema schema) { return cls.getMappingRepository().getMappingDefaults(). getTableIdentifier(cls, schema); } }, _schemaName, tableName, adapt); t.setComment(cls.getTypeAlias() == null ? cls.getDescribedType().getName() : cls.getTypeAlias()); return t; }