FieldMapping fm = (FieldMapping) ef.nextElement();
// Identity are defined at field.
if (isExistFieldId && fm.getIdentity()) {
// Get field type.
TypeInfo typeinfo = null;
String sqltype = fm.getSql().getType();
if (sqltype != null) {
typeinfo = _typeMapper.getType(sqltype);
}
if (typeinfo == null) {
String[] refRefType = resolveTypeReferenceForIds(fm
.getType());
for (int l = 0; l < refRefType.length; l++) {
types.add(refRefType[l]);
isFoundKey = true;
}
} else {
for (int i = 0; i < fm.getSql().getNameCount(); i++) {
types.add(fm.getSql().getType());
isFoundKey = true;
}
}
} else if (!isExistFieldId) {
// Identities are defined at class tag.
String fieldName = fm.getName();
for (int j = 0; j < ids.length; j++) {
// If sqlnames[i] equals ids[j] we found a reference type.
if (fieldName.equals(ids[j])) {
// Check for type if this table is a reference table.
TypeInfo typeinfo = null;
String sqltype = fm.getSql().getType();
// Verify if sqltype exists.
if (sqltype != null) {
typeinfo = _typeMapper.getType(sqltype);