How to prevent adding default table alias in hibernate @Joinformula

Viewed 87

In my application I am using the following @JoinFormula

@JoinFormula(value="(select s.\"Id\" from \"Student\" s where ash.\"Class_Id\" = id)" )

However, at runtime the generated query is:

(
    select
        s.cla0_."Id"
    from
        cla0_."Student" s
    where
        s.cla0_."Class_Id" = cla0_.id) as formula4_0_,

I need to prevent adding cla0_ table alias to the formula query. How could it be done in hibernate? I am using it in spring boot, and postgres as database.

0 Answers
Related