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; }
uk.setTable( entityBinding.getTable() ); for ( Property attributeBinding : attributeBindings ) { final Iterator itr = attributeBinding.getColumnIterator();
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 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); }
key = new UniqueKey(); key.setName(indexName); key.setTable(table); table.addUniqueKey(key); uniquekeys.put(indexName, key);
key = new UniqueKey(); key.setName(indexName); key.setTable(table); table.addUniqueKey(key); uniquekeys.put(indexName, key);
UniqueKey uk = new UniqueKey(); uk.setName("_UniqueKey"); uk.setTable(table); createClassProperties( subnode,
UniqueKey uk = new UniqueKey(); uk.setName("_UniqueKey"); uk.setTable(table);
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); }