#1461 - @OneToMany with @JoinTable without table name does not default join table name

This commit is contained in:
rob bygrave
2018-08-02 22:25:48 +12:00
parent 471605619a
commit ec7e4e4935
3 changed files with 143 additions and 0 deletions
@@ -304,6 +304,12 @@ class AnnotationAssocManys extends AnnotationParser {
private void readJoinTable(JoinTable joinTable, DeployBeanPropertyAssocMany<?> prop) {
String intTableName = getFullTableName(joinTable);
if (intTableName.isEmpty()) {
BeanTable localTable = factory.getBeanTable(descriptor.getBeanType());
BeanTable otherTable = factory.getBeanTable(prop.getTargetType());
intTableName = getM2MJoinTableName(localTable, otherTable);
}
// set the intersection table
DeployTableJoin intJoin = new DeployTableJoin();
intJoin.setTable(intTableName);