public void createAllKeys() throws MappingException { super.createAllKeys(); if ( !isInverse() ) { getIndex().createForeignKey(); } }
void createPrimaryKey() { if ( !isOneToMany() ) { PrimaryKey pk = new PrimaryKey( getCollectionTable() ); pk.addColumns( getIdentifier().getColumnIterator() ); getCollectionTable().setPrimaryKey(pk); } // create an index on the key columns?? }
private void createForeignKeys() throws MappingException { // if ( !isInverse() ) { // for inverse collections, let the "other end" handle it if ( referencedPropertyName == null ) { getElement().createForeignKey(); key.createForeignKeyOfEntity( getOwner().getEntityName() ); } // } }
public void createPrimaryKey() { //Primary key constraint final Table table = getTable(); PrimaryKey pk = new PrimaryKey( table ); pk.setName( PK_ALIAS.toAliasString( table.getName() ) ); table.setPrimaryKey( pk ); pk.addColumns( getKey().getColumnIterator() ); }
public void createPrimaryKey() { //Primary key constraint PrimaryKey pk = new PrimaryKey( table ); pk.setName( PK_ALIAS.toAliasString( table.getName() ) ); table.setPrimaryKey(pk); pk.addColumns( getKey().getColumnIterator() ); }
@Override protected void augmentIdTableDefinition(Table idTable) { Column sessionIdColumn = new Column( Helper.SESSION_ID_COLUMN_NAME ); sessionIdColumn.setSqlType( "CHAR(36)" ); sessionIdColumn.setComment( "Used to hold the Hibernate Session identifier" ); idTable.addColumn( sessionIdColumn ); }
@Override public Identifier getOwningPhysicalTableName() { return collectionBinding.getOwner().getTable().getNameIdentifier(); }
public boolean isPhysicalConstraint() { return referencedTable.isPhysicalTable() && getTable().isPhysicalTable() && !referencedTable.hasDenormalizedTables(); }
@Test public void testProperCallbacks() { PersistentClassVisitorValidator vv = new PersistentClassVisitorValidator(); new RootClass( metadataBuildingContext ).accept( vv ); new Subclass( new RootClass( metadataBuildingContext ), metadataBuildingContext ).accept( vv ); new JoinedSubclass( new RootClass( metadataBuildingContext ), metadataBuildingContext ).accept( vv ); new SingleTableSubclass( new RootClass( metadataBuildingContext ), metadataBuildingContext ).accept( vv ); new UnionSubclass( new RootClass( metadataBuildingContext ), metadataBuildingContext ).accept( vv ); }
protected Iterator getDiscriminatorColumnIterator() { if ( isDiscriminatorInsertable() && !getDiscriminator().hasFormula() ) { return getDiscriminator().getColumnIterator(); } else { return super.getDiscriminatorColumnIterator(); } }
/** * Checks if the collection element is of {@link ComponentType} type. */ private boolean isEmbeddableElementType() { return propertyValue.getElement().getType() instanceof ComponentType; }
public KeyValue getIdentifier() { return getSuperclass().getIdentifier(); } public boolean hasIdentifierProperty() {
@Override public void addSubclass(Subclass subclass) throws MappingException { super.addSubclass( subclass ); setPolymorphic( true ); }
public Class getEntityPersisterClass() { if (classPersisterClass==null) { return getSuperclass().getEntityPersisterClass(); } else { return classPersisterClass; } }
public static String buildSqlDropIndexString( Dialect dialect, Table table, String name, String defaultCatalog, String defaultSchema) { return buildSqlDropIndexString( name, table.getQualifiedName( dialect, defaultCatalog, defaultSchema ) ); }
public void setTable(Table table) { this.table = table; getSuperclass().addSubclassTable(table); }
protected void addSubclassProperty(Property p) { super.addSubclassProperty(p); getSuperclass().addSubclassProperty(p); } protected void addSubclassJoin(Join j) {
@Override public String getNaturalIdCacheRegionName() { return getSuperclass().getNaturalIdCacheRegionName(); }
public String getTuplizerImplClassName(EntityMode mode) { String impl = super.getTuplizerImplClassName( mode ); if ( impl == null ) { impl = getSuperclass().getTuplizerImplClassName( mode ); } return impl; }