void createPrimaryKey() { if ( !isOneToMany() ) { PrimaryKey pk = new PrimaryKey( getCollectionTable() ); pk.addColumns( getKey().getColumnIterator() ); pk.addColumns( getElement().getColumnIterator() ); pk.addColumns( getIndex().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() ); }
void createPrimaryKey() { if ( !isOneToMany() ) { PrimaryKey pk = new PrimaryKey( getCollectionTable() ); pk.addColumns( getIdentifier().getColumnIterator() ); getCollectionTable().setPrimaryKey(pk); } // create an index on the key columns?? }
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() ); }
void createPrimaryKey() { if ( !isOneToMany() ) { PrimaryKey pk = new PrimaryKey( getCollectionTable() ); pk.addColumns( getKey().getColumnIterator() ); Iterator iter = getElement().getColumnIterator(); while ( iter.hasNext() ) { Object selectable = iter.next(); if ( selectable instanceof Column ) { Column col = (Column) selectable; if ( !col.isNullable() ) { pk.addColumn( col ); } else { return; } } } if ( pk.getColumnSpan() == getKey().getColumnSpan() ) { //for backward compatibility, allow a set with no not-null //element columns, using all columns in the row locater SQL //TODO: create an implicit not null constraint on all cols? } else { getCollectionTable().setPrimaryKey( pk ); } } else { //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() ) { 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?? }
public void createPrimaryKey() { //Primary key constraint PrimaryKey pk = new PrimaryKey(); pk.setTable(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(); pk.setTable(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(); pk.setTable(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(); pk.setTable(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 table = getTable(); pk.setTable(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 table = getTable(); pk.setTable(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 table = getTable(); pk.setTable(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 table = getTable(); pk.setTable(table); pk.setName( PK_ALIAS.toAliasString( table.getName() ) ); table.setPrimaryKey(pk); pk.addColumns( getKey().getColumnIterator() ); }
void createPrimaryKey() { if ( !isOneToMany() ) { PrimaryKey pk = new PrimaryKey(); pk.addColumns( getKey().getColumnIterator() ); Iterator iter = getElement().getColumnIterator(); while ( iter.hasNext() ) { Column col = (Column) iter.next(); if ( !col.isNullable() ) { pk.addColumn(col); } } if ( pk.getColumnSpan()==getKey().getColumnSpan() ) { //for backward compatibility, allow a set with no not-null //element columns, using all columns in the row locater SQL //TODO: create an implicit not null constraint on all cols? } else { getCollectionTable().setPrimaryKey(pk); } } else { //create an index on the key columns?? } }
void createPrimaryKey() { if ( !isOneToMany() ) { PrimaryKey pk = new PrimaryKey(); pk.addColumns( getKey().getColumnIterator() ); Iterator iter = getElement().getColumnIterator(); while ( iter.hasNext() ) { Object selectable = iter.next(); if ( selectable instanceof Column ) { Column col = (Column) selectable; if ( !col.isNullable() ) { pk.addColumn(col); } } } if ( pk.getColumnSpan()==getKey().getColumnSpan() ) { //for backward compatibility, allow a set with no not-null //element columns, using all columns in the row locater SQL //TODO: create an implicit not null constraint on all cols? } else { getCollectionTable().setPrimaryKey(pk); } } else { //create an index on the key columns?? } }
void createPrimaryKey() { if ( !isOneToMany() ) { PrimaryKey pk = new PrimaryKey(); pk.addColumns( getKey().getColumnIterator() ); Iterator iter = getElement().getColumnIterator(); while ( iter.hasNext() ) { Object selectable = iter.next(); if ( selectable instanceof Column ) { Column col = (Column) selectable; if ( !col.isNullable() ) { pk.addColumn(col); } } } if ( pk.getColumnSpan()==getKey().getColumnSpan() ) { //for backward compatibility, allow a set with no not-null //element columns, using all columns in the row locater SQL //TODO: create an implicit not null constraint on all cols? } else { getCollectionTable().setPrimaryKey(pk); } } else { //create an index on the key columns?? } }