Fix for issue 68 - findRowCount sql error when using a @Formula property in the where clause

This commit is contained in:
Rob Bygrave
2014-01-16 20:36:23 +13:00
parent 664f08fd6f
commit 73452a5f68
9 changed files with 119 additions and 7 deletions
@@ -40,11 +40,18 @@ public abstract class AbstractExpression implements SpiExpression {
public void containsMany(BeanDescriptor<?> desc, ManyWhereJoins manyWhereJoin) {
String propertyName = getPropertyName();
String propertyName = getPropertyName();
if (propertyName != null){
ElPropertyDeploy elProp = desc.getElPropertyDeploy(propertyName);
if (elProp != null && elProp.containsMany()){
manyWhereJoin.add(elProp);
if (elProp != null) {
if (elProp.containsFormulaWithJoin()) {
// for findRowCount query select clause
manyWhereJoin.addFormulaWithJoin(propertyName);
}
if (elProp.containsMany()){
// for findRowCount we join to a many property
manyWhereJoin.add(elProp);
}
}
}
}