@Override public boolean equals(Object object) { return object instanceof Column && equals( (Column) object ); }
/** * Return the column which is identified by column provided as argument. * * @param column column with atleast a name. * @return the underlying column or null if not inside this table. Note: the instance *can* be different than the input parameter, but the name will be the same. */ public Column getColumn(Column column) { if ( column == null ) { return null; } Column myColumn = (Column) columns.get( column.getCanonicalName() ); return column.equals( myColumn ) ? myColumn : null; }
private boolean propertyIteratorContainsColumn(Iterator propertyIterator, Column column) { for ( Iterator it = propertyIterator; it.hasNext(); ) { final Property property = (Property) it.next(); for ( Iterator<Selectable> selectableIterator = property.getColumnIterator(); selectableIterator.hasNext(); ) { final Selectable selectable = selectableIterator.next(); if ( column.equals( selectable ) ) { final Column iteratedColumn = (Column) selectable; if ( column.getValue().getTable().equals( iteratedColumn.getValue().getTable() ) ) { return true; } } } } return false; }
public boolean equals(Object object) { return object instanceof Column && equals( (Column) object ); }
public boolean equals(Object object) { return object instanceof Column && equals( (Column) object ); }
@Override public boolean equals(Object object) { return object instanceof Column && equals( (Column) object ); }
public boolean equals(Object object) { return object instanceof Column && equals( (Column) object ); }
public boolean equals(Object object) { return object instanceof Column && equals( (Column) object ); }
/** * Return the column which is identified by column provided as argument. * * @param column column with atleast a name. * @return the underlying column or null if not inside this table. Note: the instance *can* be different than the input parameter, but the name will be the same. */ public Column getColumn(Column column) { if ( column == null ) { return null; } Column myColumn = (Column) columns.get( column.getCanonicalName() ); return column.equals( myColumn ) ? myColumn : null; }
/** * Return the column which is identified by column provided as argument. * * @param column column with atleast a name. * @return the underlying column or null if not inside this table. Note: the instance *can* be different than the input parameter, but the name will be the same. */ public Column getColumn(Column column) { if ( column == null ) { return null; } Column myColumn = (Column) columns.get( column.getCanonicalName() ); return column.equals( myColumn ) ? myColumn : null; }
/** * Return the column which is identified by column provided as argument. * * @param column column with atleast a name. * @return the underlying column or null if not inside this table. Note: the instance *can* be different than the input parameter, but the name will be the same. */ public Column getColumn(Column column) { Column myColumn = ( Column ) columns.get( column.getName() ); if ( column.equals( myColumn ) ) { return myColumn; } else { return null; } }
/** * Return the column which is identified by column provided as argument. * * @param column column with atleast a name. * * @return the underlying column or null if not inside this table. Note: the instance *can* be different than the input parameter, but the name will be the same. */ @Override public Column getColumn(Column column) { if ( column == null ) { return null; } Column myColumn = columns.get( column.getCanonicalName() ); return column.equals( myColumn ) ? myColumn : null; }
private List<Column> columnMatches(Column[] myPkColumns, int offset, ForeignKey key) { if(key.getColumnSpan()>(myPkColumns.length-offset)) { return null; // not enough columns in the key } List<Column> columns = new ArrayList<Column>(); for (int j = 0; j < key.getColumnSpan(); j++) { Column column = myPkColumns[j+offset]; if(!column.equals(key.getColumn(j))) { return null; } else { columns.add(column); } } return columns.isEmpty()?null:columns; }
private List<Column> columnMatches(Column[] myPkColumns, int offset, ForeignKey key) { if(key.getColumnSpan()>(myPkColumns.length-offset)) { return null; // not enough columns in the key } List<Column> columns = new ArrayList<Column>(); for (int j = 0; j < key.getColumnSpan(); j++) { Column column = myPkColumns[j+offset]; if(!column.equals(key.getColumn(j))) { return null; } else { columns.add(column); } } return columns.isEmpty()?null:columns; }
private boolean propertyIteratorContainsColumn(Iterator propertyIterator, Column column) { while ( propertyIterator.hasNext() ) { final Property property = (Property) propertyIterator.next(); for ( MappedColumn mappedColumn : property.getMappedColumns() ) { if ( column.equals( mappedColumn ) ) { final Column iteratedColumn = (Column) mappedColumn; if ( column.getTableName().equals( iteratedColumn.getTableName() ) ) { return true; } } } } return false; }
public boolean isForeignKeyCollectionInverse(String name, TableIdentifier foreignKeyTable, List<?> columns, TableIdentifier foreignKeyReferencedTable, List<?> referencedColumns) { Table fkTable = getRuntimeInfo().getTable(foreignKeyTable); if(fkTable==null) { return true; // we don't know better } if(isManyToManyTable(fkTable)) { // if the reference column is the first one then we are inverse. Column column = fkTable.getColumn(0); Column fkColumn = (Column) referencedColumns.get(0); if(fkColumn.equals(column)) { return true; } else { return false; } } return true; }
public boolean isForeignKeyCollectionInverse(String name, TableIdentifier foreignKeyTable, List<?> columns, TableIdentifier foreignKeyReferencedTable, List<?> referencedColumns) { Table fkTable = getRuntimeInfo().getTable(foreignKeyTable); if(fkTable==null) { return true; // we don't know better } if(isManyToManyTable(fkTable)) { // if the reference column is the first one then we are inverse. Column column = fkTable.getColumn(0); Column fkColumn = (Column) referencedColumns.get(0); if(fkColumn.equals(column)) { return true; } else { return false; } } return true; }