Quantcast

Can someone translate this error?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Can someone translate this error?

Patrick T
Hello Everyone,

I'm getting an error when using JPA that I don't know what it means. I have a bidirectional one to many relationship between Person and Request History entities. When I try to get all the Person objects, I get the following error:
Field "Person.reqhistoryList" cannot declare that it is mapped by another field. Its mapping strategy (org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy) does not support mapping by another field.

Can anyone provide me some insight on what this error is? Thanks.

Patrick
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can someone translate this error?

Pinaki Poddar
1. Post the definition of Person and RequestHistory.
2. There was an intermittent version of OpenJPA build that had a bug on how mapping strategies are installed and often showed up as error similar to yours. Which build version of OpenJPA are you using?
  Version information can be printed by:
  $ java -jar /path/to/openjpa.jar
  or
  $ java org.apache.openjpa.lib.conf.OpenJPAVersion


Pinaki Poddar
Chair, Apache OpenJPA Project
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can someone translate this error?

Patrick T
Person has a one to many relationship with RequestHistory. RequestHistory is a list of permission requests sent for a person. The version I'm using is OpenJPA 1.0.1. The relationships are as follows:

Person:
@javax.persistence.OneToMany(mappedBy="personId",fetch=javax.persistence.FetchType.EAGER)
        private List<ReqHistory> reqhistoryList;

ReqHistory
        @Column(name="PERSON_ID")
        @javax.persistence.ManyToOne
        @javax.persistence.JoinColumn(name="PERSON_ID")
        private Person personId;

Pinaki Poddar wrote
1. Post the definition of Person and RequestHistory.
2. There was an intermittent version of OpenJPA build that had a bug on how mapping strategies are installed and often showed up as error similar to yours. Which build version of OpenJPA are you using?
  Version information can be printed by:
  $ java -jar /path/to/openjpa.jar
  or
  $ java org.apache.openjpa.lib.conf.OpenJPAVersion

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can someone translate this error?

Patrick T
In reply to this post by Patrick T
I found out the issue. For some reason, my persistence.xml did not have the entry for ReqHistory. It normally enters it automatically when I specify it, but for this case for some reason, the IDE did not. Thanks.

bigbird wrote
Hello Everyone,

I'm getting an error when using JPA that I don't know what it means. I have a bidirectional one to many relationship between Person and Request History entities. When I try to get all the Person objects, I get the following error:
Field "Person.reqhistoryList" cannot declare that it is mapped by another field. Its mapping strategy (org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy) does not support mapping by another field.

Can anyone provide me some insight on what this error is? Thanks.

Patrick
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can someone translate this error?

papajdo
In reply to this post by Patrick T
Hi Big,

I think the problem might be that you have specified both Column and  
JoinColumn.

Can you try with using just Column and another try with just JoinColumn?

Based on these three tries, we can probably file a JIRA to improve  
error reporting.

Thanks,

Craig

On Jan 15, 2008, at 6:38 AM, bigbird wrote:

>
> Person has a one to many relationship with RequestHistory.  
> RequestHistory is
> a list of permission requests sent for a person. The version I'm  
> using is
> OpenJPA 1.0.1. The relationships are as follows:
>
> Person:
> @javax
> .persistence
> .OneToMany
> (mappedBy="personId",fetch=javax.persistence.FetchType.EAGER)
> private List<ReqHistory> reqhistoryList;
>
> ReqHistory
> @Column(name="PERSON_ID")
> @javax.persistence.ManyToOne
> @javax.persistence.JoinColumn(name="PERSON_ID")
> private Person personId;
>
>
> Pinaki Poddar wrote:
>>
>> 1. Post the definition of Person and RequestHistory.
>> 2. There was an intermittent version of OpenJPA build that had a  
>> bug on
>> how mapping strategies are installed and often showed up as error  
>> similar
>> to yours. Which build version of OpenJPA are you using?
>>  Version information can be printed by:
>>  $ java -jar /path/to/openjpa.jar
>>  or
>>  $ java org.apache.openjpa.lib.conf.OpenJPAVersion
>>
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Can-someone-translate-this-error--tp14814893p14841220.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>
Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:[hidden email]
P.S. A good JDO? O, Gasp!


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can someone translate this error?

Brian Gregory
I've searched through my persistence classes and can't find any cases where I'm using both Column and JoinColumn on a property in the same class, although I'm not sure if I understand exactly what case you're talking about.

Is there a way I can get logging output to tell what class its complaining about?


Craig L Russell wrote
I think the problem might be that you have specified both Column and  
JoinColumn.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can someone translate this error?

Brian Gregory
Never mind, I'm a little confused about conversations here.

Loading...