uk.setName( ukName.render( mappingDocument.getMetadataCollector().getDatabase().getDialect() ) ); entityBinding.getTable().addUniqueKey( uk );
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); }
this.currentIndex = null; } else if ("unique".equals(name)) { this.currentTable.addUniqueKey(this.currentUnique); this.currentUnique = null; } else if ("key".equals(name)) {
key.setName(indexName); key.setTable(table); table.addUniqueKey(key); uniquekeys.put(indexName, key);
key.setName(indexName); key.setTable(table); table.addUniqueKey(key); uniquekeys.put(indexName, key);
table.addUniqueKey(uk);
true ); table.addUniqueKey(uk);
true ); table.addUniqueKey(uk);
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); }
true ); table.addUniqueKey(uk);