QueryFieldInfo lfi = findFieldInfo(q.getField(), q);
QueryFieldInfo rfi = findFieldInfo(q.getRfield(), q);
if (lfi.getFieldEntity() == currentEntity) {
if (rfi.getFieldEntity() != currentEntity) {
Value value = bind(rfi);
<BUG>return new ValueComparisonExpression(addPrefix(lfi.getEntityRelativeFieldName()), q.getOp(), value);
</BUG>
} else if (nestedFieldPrefix.isEmpty()) {
return q;
} else {

QueryFieldInfo lfi = findFieldInfo(q.getField(), q);
QueryFieldInfo rfi = findFieldInfo(q.getRfield(), q);
if (lfi.getFieldEntity() == currentEntity) {
if (rfi.getFieldEntity() != currentEntity) {
Value value = bind(rfi);
return new ValueComparisonExpression(removeContext(lfi.getFieldEntity(),addPrefix(lfi.getEntityRelativeFieldName())), q.getOp(), value);
} else if (nestedFieldPrefix.isEmpty()) {
return q;
} else {
