@Override public void createForeignKeys() { includedTable.createForeignKeys(); Iterator iter = includedTable.getForeignKeyIterator(); while ( iter.hasNext() ) { ForeignKey fk = (ForeignKey) iter.next(); createForeignKey( Constraint.generateName( fk.generatedConstraintNamePrefix(), this, fk.getColumns() ), fk.getColumns(), fk.getReferencedEntityName(), fk.getKeyDefinition(), fk.getReferencedColumns() ); } }
Set<ForeignKey> done, final MetadataBuildingContext buildingContext) throws MappingException { table.createForeignKeys();
public void createForeignKeys() { includedTable.createForeignKeys(); Iterator iter = includedTable.getForeignKeyIterator(); while ( iter.hasNext() ) { ForeignKey fk = (ForeignKey) iter.next(); this.createForeignKey( fk.getName() + Integer.toHexString( getName().hashCode() ), fk.getColumns(), fk.getReferencedEntityName() ); } }
public void createForeignKeys() { includedTable.createForeignKeys(); Iterator iter = includedTable.getForeignKeyIterator(); while ( iter.hasNext() ) { ForeignKey fk = (ForeignKey) iter.next(); createForeignKey( fk.getName() + Integer.toHexString( getName().hashCode() ), fk.getColumns(), fk.getReferencedEntityName() ); } }
@Override public void createForeignKeys() { includedTable.createForeignKeys(); Iterator iter = includedTable.getForeignKeyIterator(); while ( iter.hasNext() ) { ForeignKey fk = (ForeignKey) iter.next(); createForeignKey( fk.getName() + Integer.toHexString( getName().hashCode() ), fk.getColumns(), fk.getReferencedEntityName() ); } }
@Override public void createForeignKeys() { includedTable.createForeignKeys(); Iterator iter = includedTable.getForeignKeyIterator(); while ( iter.hasNext() ) { ForeignKey fk = (ForeignKey) iter.next(); createForeignKey( fk.getName() + Integer.toHexString( getName().hashCode() ), fk.getColumns(), fk.getReferencedEntityName() ); } }
protected void secondPassCompileForeignKeys(Table table, Set done) throws MappingException { table.createForeignKeys(); Iterator iter = table.getForeignKeyIterator(); while ( iter.hasNext() ) { ForeignKey fk = ( ForeignKey ) iter.next(); if ( !done.contains( fk ) ) { done.add( fk ); final String referencedEntityName = fk.getReferencedEntityName(); if (referencedEntityName==null) { throw new MappingException("An association from the table "+ fk.getTable().getName() + " does not specify the referenced entity" ); } if ( log.isDebugEnabled() ) { log.debug( "resolving reference to class: " + referencedEntityName ); } PersistentClass referencedClass = ( PersistentClass ) classes.get( referencedEntityName ); if ( referencedClass == null ) { throw new MappingException( "An association from the table " + fk.getTable().getName() + " refers to an unmapped class: " + referencedEntityName ); } if ( referencedClass.isJoinedSubclass() ) { secondPassCompileForeignKeys( referencedClass.getSuperclass().getTable(), done ); } fk.setReferencedTable( referencedClass.getTable() ); } } }
protected void secondPassCompileForeignKeys(Table table, Set done) throws MappingException { table.createForeignKeys();
protected void secondPassCompileForeignKeys(Table table, Set<ForeignKey> done) throws MappingException { table.createForeignKeys(); Iterator iter = table.getForeignKeyIterator(); while ( iter.hasNext() ) {
protected void secondPassCompileForeignKeys(Table table, Set<ForeignKey> done) throws MappingException { table.createForeignKeys(); Iterator iter = table.getForeignKeyIterator(); while ( iter.hasNext() ) {