Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Customize Secondary Table - add where clause condition
PostPosted: Mon Oct 16, 2017 4:37 pm 
Newbie

Joined: Mon Oct 16, 2017 4:23 pm
Posts: 1
First, thanks to everyone keeping Hibernate fresh and relevant. I know first-hand
what happens when your project is abandoned ... don't throw things at me, I worked
for TopLink/EclipseLink for ~10 years, left Oracle and watched rather helplessly from
the sidelines as it withered-on-the-vine :-(

When using @SecondaryTable(name="tbl2") with EclipseLink, there was a 'back-door'
way to customize the join condition to add (for example) 'tbl2.is_active=true'. Is there
anyway to do that in Hibernate? (on 5.0.12.Final)

---
Mike Norman
(Remember: if someone says "ORM's are easy", ask how many ways to map a 1:1 relationship.
If they can't come up with 5 (the real answer is 9), don't listen to them!


Top
 Profile  
 
 Post subject: Re: customize Secondary Table: add where condition
PostPosted: Tue Oct 17, 2017 1:14 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1515
You can the hibernate-specific @Where annotation at the entity level as explained in this article.

_________________
If you liked my answer, you are going to love my High-Performance Java Persistence book and my blog as well.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.