sub.setPrimaryKeyColumns(fk.getColumns()); sub.setIdentityType(base.getIdentityType()); sub.setStrategy(new VerticalClassStrategy(), null);
sub.setPrimaryKeyColumns(fk.getColumns()); sub.setIdentityType(base.getIdentityType()); sub.setStrategy(new VerticalClassStrategy(), null);
sub.setPrimaryKeyColumns(fk.getColumns()); sub.setIdentityType(base.getIdentityType()); sub.setStrategy(new VerticalClassStrategy(), null);
sub.setPrimaryKeyColumns(fk.getColumns()); sub.setIdentityType(base.getIdentityType()); sub.setStrategy(new VerticalClassStrategy(), null);
/** * Attempt to create a base class from the given table. */ private void mapBaseClass(Table table) { ClassMapping cls = newClassMapping(table, null); if (cls == null) return; // check for datastore identity and builtin identity; for now // we assume that any non-datastore single primary key column will use // builtin identity; if we discover that the primary key field is // not compatible with builtin identity later, then we'll assign // an application identity class Column[] pks = table.getPrimaryKey().getColumns(); cls.setPrimaryKeyColumns(pks); if (pks.length == 1 && _datastore && pks[0].isCompatible(Types.BIGINT, null, 0, 0)) { cls.setObjectIdType(null, false); cls.setIdentityType(ClassMapping.ID_DATASTORE); } else if (pks.length == 1 && _builtin) cls.setObjectIdType(null, false); cls.setStrategy(new FullClassStrategy(), null); if (_custom != null) _custom.customize(cls); }
/** * Attempt to create a base class from the given table. */ private void mapBaseClass(Table table) { ClassMapping cls = newClassMapping(table, null); if (cls == null) return; // check for datastore identity and builtin identity; for now // we assume that any non-datastore single primary key column will use // builtin identity; if we discover that the primary key field is // not compatible with builtin identity later, then we'll assign // an application identity class Column[] pks = table.getPrimaryKey().getColumns(); cls.setPrimaryKeyColumns(pks); if (pks.length == 1 && _datastore && pks[0].isCompatible(Types.BIGINT, null, 0, 0)) { cls.setObjectIdType(null, false); cls.setIdentityType(ClassMapping.ID_DATASTORE); } else if (pks.length == 1 && _builtin) cls.setObjectIdType(null, false); cls.setStrategy(new FullClassStrategy(), null); if (_custom != null) _custom.customize(cls); }
/** * Attempt to create a base class from the given table. */ private void mapBaseClass(Table table) { ClassMapping cls = newClassMapping(table, null); if (cls == null) return; // check for datastore identity and builtin identity; for now // we assume that any non-datastore single primary key column will use // builtin identity; if we discover that the primary key field is // not compatible with builtin identity later, then we'll assign // an application identity class Column[] pks = table.getPrimaryKey().getColumns(); cls.setPrimaryKeyColumns(pks); if (pks.length == 1 && _datastore && pks[0].isCompatible(Types.BIGINT, null, 0, 0)) { cls.setObjectIdType(null, false); cls.setIdentityType(ClassMapping.ID_DATASTORE); } else if (pks.length == 1 && _builtin) cls.setObjectIdType(null, false); cls.setStrategy(new FullClassStrategy(), null); if (_custom != null) _custom.customize(cls); }
/** * Attempt to create a base class from the given table. */ private void mapBaseClass(Table table) { ClassMapping cls = newClassMapping(table, null); if (cls == null) return; // check for datastore identity and builtin identity; for now // we assume that any non-datastore single primary key column will use // builtin identity; if we discover that the primary key field is // not compatible with builtin identity later, then we'll assign // an application identity class Column[] pks = table.getPrimaryKey().getColumns(); cls.setPrimaryKeyColumns(pks); if (pks.length == 1 && _datastore && pks[0].isCompatible(Types.BIGINT, null, 0, 0)) { cls.setObjectIdType(null, false); cls.setIdentityType(ClassMapping.ID_DATASTORE); } else if (pks.length == 1 && _builtin) cls.setObjectIdType(null, false); cls.setStrategy(new FullClassStrategy(), null); if (_custom != null) _custom.customize(cls); }
/** * Attempt to create a base class from the given table. */ private void mapBaseClass(Table table) { ClassMapping cls = newClassMapping(table, null); if (cls == null) return; // check for datastore identity and builtin identity; for now // we assume that any non-datastore single primary key column will use // builtin identity; if we discover that the primary key field is // not compatible with builtin identity later, then we'll assign // an application identity class Column[] pks = table.getPrimaryKey().getColumns(); cls.setPrimaryKeyColumns(pks); if (pks.length == 1 && _datastore && pks[0].isCompatible(Types.BIGINT, null, 0, 0)) { cls.setObjectIdType(null, false); cls.setIdentityType(ClassMapping.ID_DATASTORE); } else if (pks.length == 1 && _builtin) cls.setObjectIdType(null, false); cls.setStrategy(new FullClassStrategy(), null); if (_custom != null) _custom.customize(cls); }
public void map(boolean adapt) { ValueMapping vm = cls.getEmbeddingMapping(); if (vm == null || vm.getType() != cls.getDescribedType()) throw new MetaDataException(_loc.get("not-embed", cls)); ClassMappingInfo info = cls.getMappingInfo(); info.assertNoSchemaComponents(cls, true); ClassMapping owner = vm.getFieldMapping().getDefiningMapping(); cls.setIdentityType(owner.getIdentityType()); cls.setObjectIdType(owner.getObjectIdType(), owner.isObjectIdTypeShared()); cls.setTable(vm.getFieldMapping().getTable()); cls.setPrimaryKeyColumns(owner.getPrimaryKeyColumns()); cls.setColumnIO(owner.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 (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) { ValueMapping vm = cls.getEmbeddingMapping(); if (vm == null || vm.getType() != cls.getDescribedType()) throw new MetaDataException(_loc.get("not-embed", cls)); ClassMappingInfo info = cls.getMappingInfo(); info.assertNoSchemaComponents(cls, true); ClassMapping owner = null; if (vm.getValueMappedByMapping() != null) owner = vm.getValueMappedByMapping().getDefiningMapping(); else owner = vm.getFieldMapping().getDefiningMapping(); cls.setIdentityType(owner.getIdentityType()); cls.setObjectIdType(owner.getObjectIdType(), owner.isObjectIdTypeShared()); cls.setTable(vm.getFieldMapping().getTable()); cls.setPrimaryKeyColumns(owner.getPrimaryKeyColumns()); cls.setColumnIO(owner.getColumnIO()); }
public void map(boolean adapt) { ValueMapping vm = cls.getEmbeddingMapping(); if (vm == null || vm.getType() != cls.getDescribedType()) throw new MetaDataException(_loc.get("not-embed", cls)); ClassMappingInfo info = cls.getMappingInfo(); info.assertNoSchemaComponents(cls, true); ClassMapping owner = null; if (vm.getValueMappedByMapping() != null) owner = vm.getValueMappedByMapping().getDefiningMapping(); else owner = vm.getFieldMapping().getDefiningMapping(); cls.setIdentityType(owner.getIdentityType()); cls.setObjectIdType(owner.getObjectIdType(), owner.isObjectIdTypeShared()); cls.setTable(vm.getFieldMapping().getTable()); cls.setPrimaryKeyColumns(owner.getPrimaryKeyColumns()); cls.setColumnIO(owner.getColumnIO()); }
public void map(boolean adapt) { ValueMapping vm = cls.getEmbeddingMapping(); if (vm == null || vm.getType() != cls.getDescribedType()) throw new MetaDataException(_loc.get("not-embed", cls)); ClassMappingInfo info = cls.getMappingInfo(); info.assertNoSchemaComponents(cls, true); ClassMapping owner = null; if (vm.getValueMappedByMapping() != null) owner = vm.getValueMappedByMapping().getDefiningMapping(); else owner = vm.getFieldMapping().getDefiningMapping(); cls.setIdentityType(owner.getIdentityType()); cls.setObjectIdType(owner.getObjectIdType(), owner.isObjectIdTypeShared()); cls.setTable(vm.getFieldMapping().getTable()); cls.setPrimaryKeyColumns(owner.getPrimaryKeyColumns()); cls.setColumnIO(owner.getColumnIO()); }
public void map(boolean adapt) { ValueMapping vm = cls.getEmbeddingMapping(); if (vm == null || vm.getType() != cls.getDescribedType()) throw new MetaDataException(_loc.get("not-embed", cls)); ClassMappingInfo info = cls.getMappingInfo(); info.assertNoSchemaComponents(cls, true); ClassMapping owner = null; if (vm.getValueMappedByMapping() != null) owner = vm.getValueMappedByMapping().getDefiningMapping(); else owner = vm.getFieldMapping().getDefiningMapping(); cls.setIdentityType(owner.getIdentityType()); cls.setObjectIdType(owner.getObjectIdType(), owner.isObjectIdTypeShared()); cls.setTable(vm.getFieldMapping().getTable()); cls.setPrimaryKeyColumns(owner.getPrimaryKeyColumns()); cls.setColumnIO(owner.getColumnIO()); }
cls.setPrimaryKeyColumns(pkCols); cls.setColumnIO(info.getColumnIO());