List of usage examples for org.hibernate.mapping Column equals
@SuppressWarnings("SimplifiableIfStatement") public boolean equals(Column column)
From source file:org.openeos.tools.hibernate.hbm2java.UnoReverseEngineeringStrategy.java
License:Apache License
@Override public boolean isForeignKeyCollectionInverse(String name, TableIdentifier foreignKeyTable, List columns, TableIdentifier foreignKeyReferencedTable, List referencedColumns) { Table fkTable = runtimeInfo.getTable(foreignKeyTable); if (fkTable == null) { return true; // we don't know better }// w w w .j a va2 s. c o m 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; }
From source file:org.web4thejob.orm.UniqueKeyConstraintImpl.java
License:Open Source License
public PropertyMetadata getPropertyForColumn(Column column) { PersistentClass pc = ContextUtil.getBean(HibernateConfiguration.class).getConfiguration() .getClassMapping(entityMetadata.getName()); while (pc != null) { for (Iterator<?> iterProps = pc.getPropertyIterator(); iterProps.hasNext();) { Property property = (Property) iterProps.next(); for (Iterator<?> iterCols = property.getColumnIterator(); iterCols.hasNext();) { Column col = (Column) iterCols.next(); if (col.equals(column)) { return entityMetadata.getPropertyMetadata(property.getName()); }//w w w .ja va 2 s.com } } pc = pc.getSuperclass(); } return null; }