Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using a non-pk join column in @Formula annotation

 
Benny Zlo
Greenhorn
Posts: 7
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am trying to access a join column (the join is performed using @SecondaryTables annotation) in the @Formula annoation.

I have something like this


Now when I look at the query generated by hibernate, I see that he does not use the alias it made for sectable1 to get some_other_column in the @Formula, but it uses the alias it made for primary_table.

How can I fix this? I came across @JoinColumnsOrFormulas I am not really sure if it's relevant to my problem, but regardless I have seen that is available only since 3.5.1, and unfortunately we are using Hibernate 3.2 (don't ask), and upgrading at this time would be quite a problem. So is there any other way?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic