Inability to set alias for binding literal value
var select = resultRawCriteriaBuilder
.from(ObjCommunication.class, "com")
.bind("type").select("'" + EntityType.COMMUNICATION + "'", "type")
.bind("id").select("com.id")
.bind("itemCreateDate").select("com.communicationBeginDate");
This generates this query (among other unions)
from (select top 100 percent 'COMMUNICATION', oc1_0.id, oc1_0.communication_begin_date
from obj_communication oc1_0
where oc1_0.partner_code = ?
order by oc1_0.communication_begin_date desc) grp_0_
union
Hibernate generates select * from grp_0_.* which is wrong, there has to be an alias
But SQL server fails on
No column name was specified for column 1 of 'grp_0_'.
And I have no option how to force an alias to 'COMMUNICATION' literal column.
Hibernate version 6.5.3.Final Blaze BOM version 1.6.12
Hi and sorry it took so long for me to respond. This looks like a bug in Hibernate ORM, but to be able to look into it more deeply, I'd need a reproducer. Could you please try to create one e.g. based on one of our quickstarts?
I think you could workaround this in the meantime by using the internal alias function.
Hi and sorry it took so long for me to respond. This looks like a bug in Hibernate ORM, but to be able to look into it more deeply, I'd need a reproducer. Could you please try to create one e.g. based on one of our quickstarts?
I think you could workaround this in the meantime by using the internal alias function.
I have tried ALIAS function, It has not worked. I will try to prepare example but I do not know when.