private void addConstraintToColumns(List<Column> columns) { if ( unique ) { UniqueKey uniqueKey = table.getOrCreateUniqueKey( indexName ); for ( Column column : columns ) { uniqueKey.addColumn( column ); } } else { Index index = table.getOrCreateIndex( indexName ); for ( Column column : columns ) { index.addColumn( column ); } } } }
keyName = keyNameIdentifier.render( getDatabase().getJdbcEnvironment().getDialect() ); Index index = table.getOrCreateIndex( keyName ); for ( int i = 0; i < columns.length; i++ ) { Column column = columns[i];
private void addConstraintToColumn(final String columnName ) { Column column = table.getColumn( new Column( buildingContext.getMetadataCollector().getPhysicalColumnName( table, columnName ) ) ); if ( column == null ) { throw new AnnotationException( "@Index references a unknown column: " + columnName ); } if ( unique ) { table.getOrCreateUniqueKey( indexName ).addColumn( column ); } else { table.getOrCreateIndex( indexName ).addColumn( column ); } }
table.getOrCreateIndex( name ).addColumn( column );
private void addConstraintToColumn(String columnName) { Column column = table.getColumn( new Column( mappings.getPhysicalColumnName( columnName, table ) ) ); if ( column == null ) { throw new AnnotationException( "@Index references a unknown column: " + columnName ); } if ( unique ) table.getOrCreateUniqueKey( indexName ).addColumn( column ); else table.getOrCreateIndex( indexName ).addColumn( column ); } }
private static void bindIndex(Attribute indexAttribute, Table table, Column column) { if ( indexAttribute != null && table != null ) { StringTokenizer tokens = new StringTokenizer( indexAttribute.getValue(), ", " ); while ( tokens.hasMoreTokens() ) { table.getOrCreateIndex( tokens.nextToken() ).addColumn( column ); } } }
private static void bindIndex(Attribute indexAttribute, Table table, Column column, Mappings mappings) { if ( indexAttribute != null && table != null ) { StringTokenizer tokens = new StringTokenizer( indexAttribute.getValue(), ", " ); while ( tokens.hasMoreTokens() ) { table.getOrCreateIndex( tokens.nextToken() ).addColumn( column ); } } }
private static void bindIndex(Attribute indexAttribute, Table table, Column column, Mappings mappings) { if ( indexAttribute != null && table != null ) { StringTokenizer tokens = new StringTokenizer( indexAttribute.getValue(), ", " ); while ( tokens.hasMoreTokens() ) { table.getOrCreateIndex( tokens.nextToken() ).addColumn( column ); } } }
private static void bindIndex(Attribute indexAttribute, Table table, Column column, Mappings mappings) { if ( indexAttribute != null && table != null ) { StringTokenizer tokens = new StringTokenizer( indexAttribute.getValue(), ", " ); while ( tokens.hasMoreTokens() ) { table.getOrCreateIndex( tokens.nextToken() ).addColumn( column ); } } }
private static void bindIndex(String columnName, Column column, ColumnConfig cc, Table table) { if (cc == null) { return; } Object indexObj = cc.getIndex(); String indexDefinition = null; if (indexObj instanceof Boolean) { Boolean b = (Boolean) indexObj; if (b) { indexDefinition = columnName + "_idx"; } } else if (indexObj != null) { indexDefinition = indexObj.toString(); } if (indexDefinition == null) { return; } String[] tokens = indexDefinition.split(","); for (int i = 0; i < tokens.length; i++) { String index = tokens[i]; table.getOrCreateIndex(index).addColumn(column); } }
protected void bindIndex(String columnName, Column column, ColumnConfig cc, Table table) { if (cc == null) { return; } Object indexObj = cc.getIndex(); String indexDefinition = null; if (indexObj instanceof Boolean) { Boolean b = (Boolean) indexObj; if (b) { indexDefinition = columnName + "_idx"; } } else if (indexObj != null) { indexDefinition = indexObj.toString(); } if (indexDefinition == null) { return; } String[] tokens = indexDefinition.split(","); for (int i = 0; i < tokens.length; i++) { String index = tokens[i]; table.getOrCreateIndex(index).addColumn(column); } }
private void addIndexToColumn(String columnName) { Column column = table.getColumn( new Column( mappings.getPhysicalColumnName( columnName, table ) ) ); if ( column == null ) { throw new AnnotationException( "@Index references a unknown column: " + columnName ); } table.getOrCreateIndex( indexName ).addColumn( column ); } }
private void addConstraintToColumn(String columnName) { Column column = table.getColumn( new Column( mappings.getPhysicalColumnName( columnName, table ) ) ); if ( column == null ) { throw new AnnotationException( "@Index references a unknown column: " + columnName ); } if ( unique ) table.getOrCreateUniqueKey( indexName ).addColumn( column ); else table.getOrCreateIndex( indexName ).addColumn( column ); } }
private void addConstraintToColumn(String columnName) { Column column = table.getColumn( new Column( mappings.getPhysicalColumnName( columnName, table ) ) ); if ( column == null ) { throw new AnnotationException( "@Index references a unknown column: " + columnName ); } if ( unique ) table.getOrCreateUniqueKey( indexName ).addColumn( column ); else table.getOrCreateIndex( indexName ).addColumn( column ); } }