/**
* Parse @SecondaryTable(s).
*/
private void parseSecondaryTables(ClassMapping cm,
SecondaryTable... tables) {
ClassMappingInfo info = cm.getMappingInfo();
List<Column> joins = null;
for (SecondaryTable table : tables) {
DBIdentifier sName = DBIdentifier.newTable(table.name(), delimit());
if (DBIdentifier.isEmpty(sName))
throw new MetaDataException(_loc.get("second-name", cm));
if (!StringUtils.isEmpty(table.schema())) {
DBIdentifier sSchema = DBIdentifier.newSchema(table.schema(), delimit());
sName = QualifiedDBIdentifier.newPath(sSchema, sName);
}
if (table.pkJoinColumns().length > 0) {
joins = new ArrayList<Column>(table.pkJoinColumns().length);
for (PrimaryKeyJoinColumn join : table.pkJoinColumns())
joins.add(newColumn(join));
info.setSecondaryTableJoinColumns(sName, joins);
} else {
info.addSecondaryTable(sName);
}
addUniqueConstraints(sName.getName(), cm, info, table.uniqueConstraints());
}
}