else {
log.debug("No primary key found for " + table + ", using all properties as the identifier.");
keyColumns = new ArrayList();
Iterator iter = table.getColumnIterator();
while (iter.hasNext() ) {
Column col = (Column) iter.next();
keyColumns.add(col);
}
}
final TableIdentifier tableIdentifier = TableIdentifier.create(table);
String tableIdentifierStrategyName = "assigned";
boolean naturalId;
if (keyColumns.size()>1) {
log.debug("id strategy for " + rc.getEntityName() + " since it has a multiple column primary key");
naturalId = true;
id = handleCompositeKey(rc, processed, keyColumns, mapping);
idPropertyname = revengStrategy.tableToIdentifierPropertyName(tableIdentifier);
if(idPropertyname==null) {
idPropertyname = "id";
}
}
else {
pki.suggestedStrategy = revengStrategy.getTableIdentifierStrategyName(tableIdentifier);
String suggestedStrategy = pki.suggestedStrategy;
if(suggestedStrategy==null) {
suggestedStrategy = collector.getSuggestedIdentifierStrategy( tableIdentifier.getCatalog(), tableIdentifier.getSchema(), tableIdentifier.getName() );
if(suggestedStrategy==null) {
suggestedStrategy = "assigned";
}
tableIdentifierStrategyName = suggestedStrategy;
} else {
tableIdentifierStrategyName = suggestedStrategy;
}
naturalId = "assigned".equals( tableIdentifierStrategyName );
Column pkc = (Column) keyColumns.get(0);
checkColumn(pkc);
id = bindColumnToSimpleValue(table, pkc, mapping, !naturalId);
idPropertyname = revengStrategy.tableToIdentifierPropertyName(tableIdentifier);
if(idPropertyname==null) {
idPropertyname = revengStrategy.columnToPropertyName(tableIdentifier, pkc.getName() );
}
processed.add(pkc);
}
id.setIdentifierGeneratorStrategy(tableIdentifierStrategyName);