You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by bigbird <so...@hotmail.com> on 2008/01/14 22:17:29 UTC

Can someone translate this error?

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

-- 
View this message in context: http://www.nabble.com/Can-someone-translate-this-error--tp14814893p14814893.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: Can someone translate this error?

Posted by Brian Gregory <bg...@g-webdesign.com>.
Never mind, I'm a little confused about conversations here.


-- 
View this message in context: http://www.nabble.com/Can-someone-translate-this-error--tp14814893p15807976.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: Can someone translate this error?

Posted by Brian Gregory <bg...@g-webdesign.com>.
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.
> 

-- 
View this message in context: http://www.nabble.com/Can-someone-translate-this-error--tp14814893p15807946.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: Can someone translate this error?

Posted by Craig L Russell <Cr...@Sun.COM>.
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:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Re: Can someone translate this error?

Posted by bigbird <so...@hotmail.com>.
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.


Re: Can someone translate this error?

Posted by Pinaki Poddar <pp...@apache.org>.
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--tp14814893p14815002.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: Can someone translate this error?

Posted by bigbird <so...@hotmail.com>.
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
> 
> 

-- 
View this message in context: http://www.nabble.com/Can-someone-translate-this-error--tp14814893p14841421.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.