Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using a non-pk join column in @Formula annotation  RSS feed

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

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?

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!