It's the same...I had just renamed it to queueItems in the post to make
it understand better but missed to replace in Collection.

 

Thanks and regards,

Bunty Joshi

Wells Fargo Wholesale

[email protected]

Office - 415-477-5504

     Cell - 415-407-1750

 

From: Judes Tumuhairwe (via Nabble)
[mailto:[email protected]] 
Sent: Tuesday, April 14, 2009 11:58 AM
To: Joshi, Bunty
Subject: Re: OneToMany PersistenceException

 

Joshi, 
What is the relationship between LirChecks and QueueItems? 

Judes 

On Tue, Apr 14, 2009 at 2:49 PM, JoshiJPA <bunty.jo...@...
<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2634690&i=0>
>wrote: 


> 
> Hi, 
>   I have a simple OneToMany relationship. 
>   User --> Queue --> QueueItems 
> A user has a colletion of Queues and each Queue has a colletion of 
> QueueItems. 
> 
> Now, 
>   - User and Queue are joined by a Join table (User_Queue table), but 
>   - Queue and QueueItems are joined by foreign key queueId. Also
'queueId' 
> is not the primary key of  QueueItems. 
> 
> So my object structure goes like this 
> ------------------------------------------------------ 
> @Entity 
> @Table(name = "User") 
> public class User implements Serializable { 
>   . 
>   . 
>   . 
>  @OneToMany(fetch=FetchType.EAGER) 
>        @OrderBy("siteNumber,queueId ASC") 
>        @JoinTable( 
>            name="User_Queue ", 
>            joinColumns= 
>                @JoinColumn(name="USER_NAME", 
> referencedColumnName="USER_NAME"), 
>            inverseJoinColumns= 
>                @JoinColumn(name="QUEUE_ID", 
> referencedColumnName="QUEUE_ID") 
>            ) 
>        private Collection<Queue> queues; 
> 
> } 
> ---------------------------------------------------- 
> @Entity 
> @Table(name = "T_EVAL_QUEUES") 
> public class Queue implements Serializable { 
>    . 
>    . 
>    . 
>    @OneToMany(fetch=FetchType.EAGER) 
>    @ElementJoinColumn(name="QUEUE_ID",
referencedColumnName="QUEUE_ID") 
>    private Collection<LirChecks> lirChecks; 
> 
> } 
> ------------------------------------------------------ 
> 
> @Entity 
> @Table(name = "Queue_Items") 
> public class QueueItems implements Serializable { 
>     . 
>     . 
>     . 
>   @Column (name = "QUEUE_ID") 
>    private Integer queueId; 
> } 
> 
> 
> Now when I just try to fetch the queues of User then its working fine,
but 
> when I try to fetch the queueItems then its giving me an exception.
Below is 
> the exception trace. 
> 
> <openjpa-1.2.1-SNAPSHOT-r422266:686069 nonfatal general error> 
> org.apache.openjpa.persistence.PersistenceException: null 
> 
> 
> I have spent whole day yesterday on this to fix it but in vain. 
> Please advice. 
> 
> -- 
> View this message in context: 
>
http://n2.nabble.com/OneToMany-PersistenceException-tp2634657p2634657.ht
ml
> Sent from the OpenJPA Users mailing list archive at Nabble.com. 
> 
> 

 

  _____  

This email is a reply to your post @
http://n2.nabble.com/OneToMany-PersistenceException-tp2634657p2634690.ht
ml
You can reply by email or by visting the link above.

 


-- 
View this message in context: 
http://n2.nabble.com/OneToMany-PersistenceException-tp2634657p2634822.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to