This commit is contained in:
Michael Buckley 2024-09-27 17:13:27 -04:00
parent 8ecc7728c7
commit e7fed79e5c
1 changed files with 7 additions and 3 deletions

View File

@ -100,6 +100,7 @@ import com.healthmarketscience.sqlbuilder.SetOperationQuery;
import com.healthmarketscience.sqlbuilder.Subquery; import com.healthmarketscience.sqlbuilder.Subquery;
import com.healthmarketscience.sqlbuilder.UnionQuery; import com.healthmarketscience.sqlbuilder.UnionQuery;
import com.healthmarketscience.sqlbuilder.dbspec.basic.DbColumn; import com.healthmarketscience.sqlbuilder.dbspec.basic.DbColumn;
import com.healthmarketscience.sqlbuilder.dbspec.basic.DbObject;
import jakarta.annotation.Nullable; import jakarta.annotation.Nullable;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Triple; import org.apache.commons.lang3.tuple.Triple;
@ -360,7 +361,6 @@ public class QueryStack {
case STRING: case STRING:
StringPredicateBuilder stringPredicateBuilder = mySqlBuilder.createStringPredicateBuilder(); StringPredicateBuilder stringPredicateBuilder = mySqlBuilder.createStringPredicateBuilder();
addSortCustomJoin( addSortCustomJoin(
// fixme switch?
resourceLinkPredicateBuilder.getJoinColumnsForTarget(), resourceLinkPredicateBuilder.getJoinColumnsForTarget(),
stringPredicateBuilder, stringPredicateBuilder,
stringPredicateBuilder.createHashIdentityPredicate(targetType, theChain)); stringPredicateBuilder.createHashIdentityPredicate(targetType, theChain));
@ -1578,8 +1578,12 @@ public class QueryStack {
if (theSourceJoinColumn == null) { if (theSourceJoinColumn == null) {
BaseJoiningPredicateBuilder root = mySqlBuilder.getOrCreateFirstPredicateBuilder(false); BaseJoiningPredicateBuilder root = mySqlBuilder.getOrCreateFirstPredicateBuilder(false);
DbColumn[] joinColumns = root.getJoinColumns(); DbColumn[] joinColumns = root.getJoinColumns();
// fixme check for length 1 and skip tuple wrap. Object joinColumnObject;
Object joinColumnObject = ColumnTupleObject.from(joinColumns); if (joinColumns.length == 1) {
joinColumnObject = joinColumns[0];
} else {
joinColumnObject = ColumnTupleObject.from(joinColumns);
}
retVal = new InCondition(joinColumnObject, union); retVal = new InCondition(joinColumnObject, union);
} else { } else {
// -- for the resource link, need join with target_resource_id // -- for the resource link, need join with target_resource_id