#1101 - findNative() on a bean with an associated @OneToOne (with the PK being derived from the parent) maps incorrectly

This commit is contained in:
rob bygrave
2017-08-30 21:58:33 +12:00
parent 683186cbe9
commit 1d1fde61be
4 changed files with 128 additions and 1 deletions
@@ -713,7 +713,11 @@ public class BeanDescriptor<T> implements MetaBeanInfo, BeanType<T> {
}
void registerColumn(String dbColumn, String path) {
columnPath.put(dbColumn.toLowerCase(), path);
String key = dbColumn.toLowerCase();
// check for clash with imported OneToOne PK
if (!columnPath.containsKey(key)) {
columnPath.put(key, path);
}
}
void registerTable(String baseTable, BeanPropertyAssoc<?> assocProperty) {