public static boolean hasNaturalKey(TableId _tableId)
{
SysDictTable dictTable;
DictIndex dictIndex;
boolean hasNaturalKey;
TableId currentTableId;
currentTableId = _tableId;
do
{
dictTable = new SysDictTable(currentTableId);
dictIndex = dictTable.indexObject(dictTable.replacementKey());
hasNaturalKey = (dictIndex != null) && (dictIndex.numberOfFields() > 0);
currentTableId = dictTable.supportInheritance() ? dictTable.extends() : 0;
}
while (!hasNaturalKey && currentTableId != 0);
return hasNaturalKey;
}
No comments:
Post a Comment