private boolean isPrimaryKeyColumn (ColumnElement column) { if (column != null) { KeyElement key = column.getDeclaringTable().getPrimaryKey(); return ((key != null) && (key.getColumn(column.getName()) != null)); } return false; } private boolean isExactMatch (ArrayList columns1,
private List getUnmappedColumnNames (KeyElement primaryKey, MappingClassElement mappingClass) { List unmappedColumns = null; if (primaryKey != null) // check if primary table has a pk { ColumnElement[] columns = primaryKey.getColumns(); int count = ((columns != null) ? columns.length : 0); // all columns in the pk should be mapped to key fields if (count > 0) { List mappingFields = mappingClass.getFields(); Iterator iterator = mappingFields.iterator(); unmappedColumns = getRelativeColumnNames(columns); while (iterator.hasNext()) { MappingFieldElement field = (MappingFieldElement)iterator.next(); if (isKeyField(field)) unmappedColumns.removeAll(field.getColumns()); } } } return unmappedColumns; } private List getRelativeColumnNames (ColumnElement[] columns)
private boolean isPrimaryKeyColumn (ColumnElement column) { if (column != null) { KeyElement key = column.getDeclaringTable().getPrimaryKey(); return ((key != null) && (key.getColumn(column.getName()) != null)); } return false; } private boolean isExactMatch (ArrayList columns1,
private List getUnmappedColumnNames (KeyElement primaryKey, MappingClassElement mappingClass) { List unmappedColumns = null; if (primaryKey != null) // check if primary table has a pk { ColumnElement[] columns = primaryKey.getColumns(); int count = ((columns != null) ? columns.length : 0); // all columns in the pk should be mapped to key fields if (count > 0) { List mappingFields = mappingClass.getFields(); Iterator iterator = mappingFields.iterator(); unmappedColumns = getRelativeColumnNames(columns); while (iterator.hasNext()) { MappingFieldElement field = (MappingFieldElement)iterator.next(); if (isKeyField(field)) unmappedColumns.removeAll(field.getColumns()); } } } return unmappedColumns; } private List getRelativeColumnNames (ColumnElement[] columns)