-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Secondary tables joined off secondary tables
PostPosted: Fri Jun 20, 2008 5:51 pm 
Newbie

Joined: Fri Jun 20, 2008 5:36 pm
Posts: 1
I am looking to pull data from a table that is two joins away from the current object's table. Is it possible to join a secondary table off another secondary table using annotations?

Currently, I am using
Code:
@Table(name = "testobject")
@SecondaryTables({
    @SecondaryTable(name="users", pkJoinColumns={
        @PrimaryKeyJoinColumn(name="userid", referencedColumnName="userid")}),
    @SecondaryTable(name="groups",pkJoinColumns={
        @PrimaryKeyJoinColumn(name="groupid", referencedColumnName="groupid")})
})

to annotate my class. This fails due to
Code:

Caused by: org.hibernate.MappingException: Unable to find column with logical name: companyid in org.hibernate.mapping.Table(testobject) and its related supertables and secondary tables



In this case, the current object has access to userid, but needs groupid to pull information from the groups table.

Any assistance would be appreciated.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.