bug fix [ 1651801 ] GenerateModel: duplicate "getKeyNamePair" methods

* added carlos suggestion: now if there are more then one primary identifiers for a table, entire generation will fail
This commit is contained in:
teo_sarca 2007-02-04 18:51:42 +00:00
parent a4e7b53309
commit ead0410b81
1 changed files with 9 additions and 3 deletions

View File

@ -278,9 +278,15 @@ public class GenerateModel
defaultValue, ValueMin, ValueMax, VFormat,
Callout, Name, Description, virtualColumn, IsEncrypted));
//
if (!isKeyNamePairCreated && seqNo == 1 && "Y".equals(rs.getString("IsIdentifier"))) {
sb.append(createKeyNamePair(columnName, displayType));
isKeyNamePairCreated = true;
if (seqNo == 1 && "Y".equals(rs.getString("IsIdentifier"))) {
if (!isKeyNamePairCreated) {
sb.append(createKeyNamePair(columnName, displayType));
isKeyNamePairCreated = true;
}
else {
throw new RuntimeException("More than one primary identifier found "
+ " (AD_Table_ID=" + AD_Table_ID + ", ColumnName=" + columnName + ")");
}
}
}
rs.close();