ruthst00 commented on code in PR #16573:
URL: https://github.com/apache/grails-core/pull/16573#discussion_r4409506567
##########
grails-data-hibernate7/core/src/main/groovy/grails/orm/HibernateCriteriaBuilder.java:
##########
@@ -230,24 +231,16 @@ public final void setDatastore(HibernateDatastore
datastore) {
}
public org.grails.datastore.mapping.query.api.Criteria createAlias(String
associationPath, String alias) {
- var prop =
hibernateQuery.getEntity().getPropertyByName(associationPath);
- if (prop instanceof org.grails.datastore.mapping.model.types.Basic) {
- hibernateQuery.addAlias(
- new
org.grails.orm.hibernate.query.HibernateAlias(associationPath, alias,
JoinType.INNER));
- return this;
- }
- hibernateQuery.getDetachedCriteria().createAlias(associationPath,
alias);
- hibernateQuery.getDetachedCriteria().join(associationPath,
JoinType.INNER);
- return this;
+ return createAlias(associationPath, alias, 0);
}
public org.grails.datastore.mapping.query.api.Criteria createAlias(
String associationPath, String alias, int joinType) {
var prop =
hibernateQuery.getEntity().getPropertyByName(associationPath);
JoinType convertedJoinType = convertFromInt(joinType);
+ hibernateQuery.addAlias(
+ new HibernateAlias(associationPath, alias, convertedJoinType));
Review Comment:
Fixed in
https://github.com/apache/grails-core/pull/16573/changes/a151e11ec7fe529da7ae6cf3e32ee05306a48753
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]