Skip to content

Commit

Permalink
Merge pull request #22 from luiseufrasio/FISH-7076
Browse files Browse the repository at this point in the history
FISH-7076 : Malformed SQL Query caused by EclipseLink with Table per …
  • Loading branch information
luiseufrasio authored Mar 6, 2023
2 parents c31ce95 + 1097b77 commit b8f6d28
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@ public Expression rebuildOn(Expression newBase) {
}
if ((descriptor != null) && descriptor.hasTablePerClassPolicy()) {
field = field.clone();
field.setTable(descriptor.getDefaultTable());
DatabaseTable table = descriptor.getDefaultTable();
if((field.getTableName().length() != 0) && descriptor.getTableNames().contains(field.getTableName())) {
table = descriptor.getTable(field.getTableName());
}
field.setTable(table);
}
}
FieldExpression expression = new FieldExpression(field, getBaseExpression().rebuildOn(newBase));
Expand Down Expand Up @@ -310,7 +314,11 @@ public Expression twistedForBaseAndContext(Expression newBase, Expression contex
}
if ((descriptor != null) && descriptor.hasTablePerClassPolicy()) {
field = field.clone();
field.setTable(descriptor.getDefaultTable());
DatabaseTable table = descriptor.getDefaultTable();
if((field.getTableName().length() != 0) && descriptor.getTableNames().contains(field.getTableName())) {
table = descriptor.getTable(field.getTableName());
}
field.setTable(table);
}
}
return twistedBase.getField(field);
Expand Down

0 comments on commit b8f6d28

Please sign in to comment.