public UniqueKey getOrCreateUniqueKey(String keyName) { UniqueKey uk = uniqueKeys.get( keyName ); if ( uk == null ) { uk = new UniqueKey(); uk.setName( keyName ); uk.setTable( this ); uniqueKeys.put( keyName, uk ); } return uk; }
final UniqueKey uk = new UniqueKey(); uk.setTable( entityBinding.getTable() ); for ( Property attributeBinding : attributeBindings ) {
public UniqueKey getOrCreateUniqueKey(String keyName) { UniqueKey uk = (UniqueKey) uniqueKeys.get( keyName ); if ( uk == null ) { uk = new UniqueKey(); uk.setName( keyName ); uk.setTable( this ); uniqueKeys.put( keyName, uk ); } return uk; }
public UniqueKey getOrCreateUniqueKey(String keyName) { UniqueKey uk = (UniqueKey) uniqueKeys.get( keyName ); if ( uk == null ) { uk = new UniqueKey(); uk.setName( keyName ); uk.setTable( this ); uniqueKeys.put( keyName, uk ); } return uk; }
public UniqueKey getOrCreateUniqueKey(String keyName) { UniqueKey uk = ( UniqueKey ) uniqueKeys.get( keyName ); if ( uk == null ) { uk = new UniqueKey(); uk.setName( keyName ); uk.setTable( this ); uniqueKeys.put( keyName, uk ); } return uk; }
public UniqueKey getOrCreateUniqueKey(String keyName) { UniqueKey uk = (UniqueKey) uniqueKeys.get( keyName ); if ( uk == null ) { uk = new UniqueKey(); uk.setName( keyName ); uk.setTable( this ); uniqueKeys.put( keyName, uk ); } return uk; }
@Override public MappedUniqueKey getOrCreateUniqueKey(String keyName) { MappedUniqueKey uk = uniqueKeys.get( keyName ); if ( uk == null ) { uk = new UniqueKey(); uk.setName( keyName ); uk.setMappedTable( this ); uniqueKeys.put( keyName, uk ); } return uk; }
@Override public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException { if ("table".equals(name)) { this.currentColumns = new LinkedHashMap<String, Column>(); this.currentColumnTypes = new TreeMap<String, Integer>(String.CASE_INSENSITIVE_ORDER); } else if ("index".equals(name)) { this.currentIndex = new Index(); this.currentIndex.setTable(this.currentTable); } else if ("unique".equals(name)) { this.currentUnique = new UniqueKey(); this.currentUnique.setTable(this.currentTable); } this.chars = new StringBuilder(); }
protected void createUniqueKeyForColumns(Table table, String columnName, List<Column> columns) { Collections.reverse(columns); UniqueKey uk = new UniqueKey(); uk.setTable(table); uk.addColumns(columns.iterator()); if(LOG.isDebugEnabled()) { LOG.debug("create unique key for " + table.getName() + " columns = " + columns); } setGeneratedUniqueName(uk); table.addUniqueKey(uk); }
UniqueKey key = uniquekeys.get(indexName); if (key==null) { key = new UniqueKey(); key.setName(indexName); key.setTable(table);
UniqueKey key = uniquekeys.get(indexName); if (key==null) { key = new UniqueKey(); key.setName(indexName); key.setTable(table);
UniqueKey uk = new UniqueKey(); uk.setName("_UniqueKey"); uk.setTable(table);
UniqueKey uk = new UniqueKey(); uk.setName("_UniqueKey"); uk.setTable(table);
final MappedUniqueKey uk = new UniqueKey(); uk.setMappedTable( entityBinding.getMappedTable() ); for ( Property attributeBinding : attributeBindings ) {
UniqueKey uk = new UniqueKey(); uk.setName("_UniqueKey"); uk.setTable(table);
protected void bindNaturalIdentifier(Table table, Mapping mapping, PersistentClass persistentClass) { Object o = mapping != null ? mapping.getIdentity() : null; if (!(o instanceof Identity)) { return; } Identity identity = (Identity) o; final NaturalId naturalId = identity.getNatural(); if (naturalId == null || naturalId.getPropertyNames().isEmpty()) { return; } UniqueKey uk = new UniqueKey(); uk.setTable(table); boolean mutable = naturalId.isMutable(); for (String propertyName : naturalId.getPropertyNames()) { Property property = persistentClass.getProperty(propertyName); property.setNaturalIdentifier(true); if (!mutable) property.setUpdateable(false); uk.addColumns(property.getColumnIterator()); } setGeneratedUniqueName(uk); table.addUniqueKey(uk); }
private static void bindNaturalIdentifier(Table table, Mapping mapping, PersistentClass persistentClass) { Object o = mapping != null ? mapping.getIdentity() : null; if (!(o instanceof Identity)) { return; } Identity identity = (Identity) o; final NaturalId naturalId = identity.getNatural(); if (naturalId == null || naturalId.getPropertyNames().isEmpty()) { return; } UniqueKey uk = new UniqueKey(); uk.setName("_UniqueKey"); uk.setTable(table); boolean mutable = naturalId.isMutable(); for (String propertyName : naturalId.getPropertyNames()) { Property property = persistentClass.getProperty(propertyName); property.setNaturalIdentifier(true); if (!mutable) property.setUpdateable(false); uk.addColumns(property.getColumnIterator()); } table.addUniqueKey(uk); }
UniqueKey uk = new UniqueKey(); uk.setName("_UniqueKey"); uk.setTable(table);