Support @ManyToOne inside @Embeddables - fix for #52 (#1608)

* #52 - @ManyToOne support inside @Embeddables

Initial test and work

* #52 - @ManyToOne support inside @Embeddables

Initial test and work

* #52 - @ManyToOne support inside @Embeddables

Initial test and work

* #52 - @ManyToOne support inside @Embeddables

Initial test and work

* #52 - @ManyToOne support inside @Embeddables

Initial test and work

* #52 - @ManyToOne support inside @Embeddables

Initial test and work

* #52 - @ManyToOne support inside @Embeddables

Update test with sql capture

* #52 - @ManyToOne support inside @Embeddables

Update test with cache clearing before hand (such that we hit DB on lazy load)
This commit is contained in:
Rob Bygrave
2019-01-10 03:40:02 +13:00
committed by GitHub
parent 2b0669c2ae
commit 6b27a9d280
20 changed files with 356 additions and 69 deletions
@@ -46,6 +46,16 @@ public class TableJoinColumn {
this.queryHash = hash();
}
private TableJoinColumn(TableJoinColumn source, String overrideColumn) {
this.localDbColumn = InternString.intern(overrideColumn);
this.foreignDbColumn = source.foreignDbColumn;
this.localSqlFormula = null;
this.foreignSqlFormula = null;
this.insertable = source.isInsertable();
this.updateable = source.isUpdateable();
this.queryHash = hash();
}
int hash() {
int result = localDbColumn != null ? localDbColumn.hashCode() : 0;
result = 92821 * result + (foreignDbColumn != null ? foreignDbColumn.hashCode() : 0);
@@ -123,4 +133,7 @@ public class TableJoinColumn {
return foreignSqlFormula;
}
TableJoinColumn withOverrideColumn(String overrideColumn) {
return new TableJoinColumn(this, overrideColumn);
}
}