/** * Return the table for the given class. */ public Table getTable(final ClassMapping cls, boolean adapt) { 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); } }, _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) { 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) { 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; }
/** * 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; }
public void map(boolean adapt) { ClassMapping sup = cls.getMappedPCSuperclassMapping(); if (sup == null || cls.getEmbeddingMetaData() != null) throw new MetaDataException(_loc.get("not-sub", cls)); ClassMappingInfo info = cls.getMappingInfo(); info.assertNoSchemaComponents(cls, true); if (info.getTableName() != null) { Table table = info.createTable(cls, null, info.getSchemaName(), info.getTableName(), false); if (table != sup.getTable()) throw new MetaDataException(_loc.get("flat-table", cls, table.getFullName(), sup.getTable().getFullName())); } cls.setTable(sup.getTable()); cls.setPrimaryKeyColumns(sup.getPrimaryKeyColumns()); cls.setColumnIO(sup.getColumnIO()); }
public void map(boolean adapt) { ClassMapping sup = cls.getMappedPCSuperclassMapping(); if (sup == null || cls.getEmbeddingMetaData() != null) throw new MetaDataException(_loc.get("not-sub", cls)); ClassMappingInfo info = cls.getMappingInfo(); info.assertNoSchemaComponents(cls, true); if (!DBIdentifier.isNull(info.getTableIdentifier())) { Table table = info.createTable(cls, null, info.getSchemaIdentifier(), info.getTableIdentifier(), false); if (table != sup.getTable()) throw new MetaDataException(_loc.get("flat-table", cls, table.getFullName(), sup.getTable().getFullName())); } cls.setTable(sup.getTable()); cls.setPrimaryKeyColumns(sup.getPrimaryKeyColumns()); cls.setColumnIO(sup.getColumnIO()); }
public void map(boolean adapt) { ClassMapping sup = cls.getMappedPCSuperclassMapping(); if (sup == null || cls.getEmbeddingMetaData() != null) throw new MetaDataException(_loc.get("not-sub", cls)); ClassMappingInfo info = cls.getMappingInfo(); info.assertNoSchemaComponents(cls, true); if (!DBIdentifier.isNull(info.getTableIdentifier())) { Table table = info.createTable(cls, null, info.getSchemaIdentifier(), info.getTableIdentifier(), false); if (table != sup.getTable()) throw new MetaDataException(_loc.get("flat-table", cls, table.getFullName(), sup.getTable().getFullName())); } cls.setTable(sup.getTable()); cls.setPrimaryKeyColumns(sup.getPrimaryKeyColumns()); cls.setColumnIO(sup.getColumnIO()); }
public void map(boolean adapt) { ClassMapping sup = cls.getMappedPCSuperclassMapping(); if (sup == null || cls.getEmbeddingMetaData() != null) throw new MetaDataException(_loc.get("not-sub", cls)); ClassMappingInfo info = cls.getMappingInfo(); info.assertNoSchemaComponents(cls, true); if (!DBIdentifier.isNull(info.getTableIdentifier())) { Table table = info.createTable(cls, null, info.getSchemaIdentifier(), info.getTableIdentifier(), false); if (table != sup.getTable()) throw new MetaDataException(_loc.get("flat-table", cls, table.getFullName(), sup.getTable().getFullName())); } cls.setTable(sup.getTable()); cls.setPrimaryKeyColumns(sup.getPrimaryKeyColumns()); cls.setColumnIO(sup.getColumnIO()); }
public void map(boolean adapt) { ClassMapping sup = cls.getMappedPCSuperclassMapping(); if (sup == null || cls.getEmbeddingMetaData() != null) throw new MetaDataException(_loc.get("not-sub", cls)); ClassMappingInfo info = cls.getMappingInfo(); info.assertNoSchemaComponents(cls, true); if (!DBIdentifier.isNull(info.getTableIdentifier())) { Table table = info.createTable(cls, null, info.getSchemaIdentifier(), info.getTableIdentifier(), false); if (table != sup.getTable()) throw new MetaDataException(_loc.get("flat-table", cls, table.getFullName(), sup.getTable().getFullName())); } cls.setTable(sup.getTable()); cls.setPrimaryKeyColumns(sup.getPrimaryKeyColumns()); cls.setColumnIO(sup.getColumnIO()); }