public void validate(Mapping mapping) throws MappingException { super.validate( mapping ); assert getElement() != null : "IdentifierCollection identifier not bound : " + getRole(); if ( !getIdentifier().isValid(mapping) ) { throw new MappingException( "collection id mapping has wrong number of columns: " + getRole() + " type: " + getIdentifier().getType().getName() ); } } }
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 checkColumnDuplication() throws MappingException { HashSet cols = new HashSet(); checkColumnDuplication( cols, getKey() ); if ( isIndexed() ) { checkColumnDuplication( cols, ( (IndexedCollection) this ).getIndex() ); } if ( isIdentified() ) { checkColumnDuplication( cols, ( (IdentifierCollection) this ).getIdentifier() ); } if ( !isOneToMany() ) { checkColumnDuplication( cols, getElement() ); } }
private void processExportableProducers() { // for now we only handle id generators as ExportableProducers final Dialect dialect = getDatabase().getJdbcEnvironment().getDialect(); final String defaultCatalog = extractName( getDatabase().getDefaultNamespace().getName().getCatalog(), dialect ); final String defaultSchema = extractName( getDatabase().getDefaultNamespace().getName().getSchema(), dialect ); for ( PersistentClass entityBinding : entityBindingMap.values() ) { if ( entityBinding.isInherited() ) { continue; } handleIdentifierValueBinding( entityBinding.getIdentifier(), dialect, defaultCatalog, defaultSchema, (RootClass) entityBinding ); } for ( Collection collection : collectionBindingMap.values() ) { if ( !IdentifierCollection.class.isInstance( collection ) ) { continue; } handleIdentifierValueBinding( ( (IdentifierCollection) collection ).getIdentifier(), dialect, defaultCatalog, defaultSchema, null ); } }
identifierType = idColl.getIdentifier().getType(); iter = idColl.getIdentifier().getColumnIterator(); Column col = (Column) iter.next(); identifierColumnName = col.getQuotedName( dialect ); identifierColumnAlias = col.getAlias( dialect ); identifierGenerator = idColl.getIdentifier().createIdentifierGenerator( creationContext.getMetadata().getIdentifierGeneratorFactory(), factory.getDialect(),
public void validate(Mapping mapping) throws MappingException { super.validate(mapping); if ( !getIdentifier().isValid(mapping) ) { throw new MappingException( "collection id mapping has wrong number of columns: " + getRole() + " type: " + getIdentifier().getType().getName() ); } }
public void validate(Mapping mapping) throws MappingException { super.validate(mapping); if ( !getIdentifier().isValid(mapping) ) { throw new MappingException( "collection id mapping has wrong number of columns: " + getRole() + " type: " + getIdentifier().getType().getName() ); } }
public void validate(Mapping mapping) throws MappingException { super.validate(mapping); if ( !getIdentifier().isValid(mapping) ) { throw new MappingException( "collection id mapping has wrong number of columns: " + getRole() + " type: " + getIdentifier().getType().getName() ); } }
public void validate(Mapping mapping) throws MappingException { super.validate(mapping); if ( !getIdentifier().isValid(mapping) ) { throw new MappingException( "collection id mapping has wrong number of columns: " + getRole() + " type: " + getIdentifier().getType().getName() ); } }
public void validate() throws MappingException { super.validate(); assert getElement() != null : "IdentifierCollection identifier not bound : " + getRole(); if ( !getIdentifier().isValid() ) { throw new MappingException( "collection id mapping has wrong number of columns: " + getRole() + " type: " + getIdentifier().getJavaTypeMapping().getTypeName() ); } } }
void createPrimaryKey() { if ( !isOneToMany() ) { PrimaryKey pk = new PrimaryKey(); pk.addColumns( getIdentifier().getColumnIterator() ); getCollectionTable().setPrimaryKey(pk); } else { // don't create a unique key, 'cos some // databases don't like a UK on nullable // columns //getCollectionTable().createUniqueKey( getIdentifier().getConstraintColumns() ); } // create an index on the key columns?? }
void createPrimaryKey() { if ( !isOneToMany() ) { PrimaryKey pk = new PrimaryKey(); pk.addColumns( getIdentifier().getColumnIterator() ); getCollectionTable().setPrimaryKey(pk); } else { // don't create a unique key, 'cos some // databases don't like a UK on nullable // columns //getCollectionTable().createUniqueKey( getIdentifier().getConstraintColumns() ); } // create an index on the key columns?? }
void createPrimaryKey() { if ( !isOneToMany() ) { PrimaryKey pk = new PrimaryKey(); pk.addColumns( getIdentifier().getColumnIterator() ); getCollectionTable().setPrimaryKey(pk); } else { // don't create a unique key, 'cos some // databases don't like a UK on nullable // columns //getCollectionTable().createUniqueKey( getIdentifier().getConstraintColumns() ); } // create an index on the key columns?? }
void createPrimaryKey() { if ( !isOneToMany() ) { PrimaryKey pk = new PrimaryKey(); pk.addColumns( getIdentifier().getColumnIterator() ); getCollectionTable().setPrimaryKey(pk); } else { // don't create a unique key, 'cos some // databases don't like a UK on nullable // columns //getCollectionTable().createUniqueKey( getIdentifier().getConstraintColumns() ); } // create an index on the key columns?? }
void createPrimaryKey() { if ( !isOneToMany() ) { MappedPrimaryKey pk = new PrimaryKey( getMappedTable() ); pk.addColumns( getIdentifier().getMappedColumns() ); getMappedTable().setPrimaryKey(pk); } // create an index on the key columns?? }
private void checkColumnDuplication() throws MappingException { HashSet cols = new HashSet(); checkColumnDuplication( cols, getKey() ); if ( isIndexed() ) { checkColumnDuplication( cols, ( (IndexedCollection) this ).getIndex() ); } if ( isIdentified() ) { checkColumnDuplication( cols, ( (IdentifierCollection) this ).getIdentifier() ); } if ( !isOneToMany() ) { checkColumnDuplication( cols, getElement() ); } }
private void checkColumnDuplication() throws MappingException { HashSet cols = new HashSet(); checkColumnDuplication( cols, getKey().getColumnIterator() ); if ( isIndexed() ) { checkColumnDuplication( cols, ( (IndexedCollection) this ) .getIndex() .getColumnIterator() ); } if ( isIdentified() ) { checkColumnDuplication( cols, ( (IdentifierCollection) this ) .getIdentifier() .getColumnIterator() ); } if ( !isOneToMany() ) { checkColumnDuplication( cols, getElement().getColumnIterator() ); } }
private void checkColumnDuplication() throws MappingException { HashSet cols = new HashSet(); checkColumnDuplication( cols, getKey().getColumnIterator() ); if ( isIndexed() ) { checkColumnDuplication( cols, ( (IndexedCollection) this ) .getIndex() .getColumnIterator() ); } if ( isIdentified() ) { checkColumnDuplication( cols, ( (IdentifierCollection) this ) .getIdentifier() .getColumnIterator() ); } if ( !isOneToMany() ) { checkColumnDuplication( cols, getElement().getColumnIterator() ); } }
private void checkColumnDuplication() throws MappingException { HashSet cols = new HashSet(); checkColumnDuplication( cols, getKey().getColumnIterator() ); if ( isIndexed() ) { checkColumnDuplication( cols, ( (IndexedCollection) this ) .getIndex() .getColumnIterator() ); } if ( isIdentified() ) { checkColumnDuplication( cols, ( (IdentifierCollection) this ) .getIdentifier() .getColumnIterator() ); } if ( !isOneToMany() ) { checkColumnDuplication( cols, getElement().getColumnIterator() ); } }
private void checkColumnDuplication() throws MappingException { HashSet cols = new HashSet(); checkColumnDuplication( cols, getKey().getColumnIterator() ); if ( isIndexed() ) { checkColumnDuplication( cols, ( (IndexedCollection) this ) .getIndex() .getColumnIterator() ); } if ( isIdentified() ) { checkColumnDuplication( cols, ( (IdentifierCollection) this ) .getIdentifier() .getColumnIterator() ); } if ( !isOneToMany() ) { checkColumnDuplication( cols, getElement().getColumnIterator() ); } }