I am trying to map an entity as following
@OneToOne(mappedBy = "localizedLabel")
@JoinColumn(insertable = false, updatable = false)
@WhereJoinTable(clause = "locale='en_US'")
public Localization getEn_US() {
return en_US;
}
I can assure that the data will return only one or null if the not found, but hibernate seems to ignore my @Where clause:
ERROR com.eventtouch.bc.business.core.log.LoggingInterceptor - org.hibernate.HibernateException: More than one row with the given identifier was found: 4211, for class: com.eventtouch.bc.business.domain.LocalizedLabel
Any ideas on ho to map a @OneToOne relationship with @Where clause?
Thanks