You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Joe_DAMS <or...@kizux.fr> on 2014/03/19 15:03:21 UTC

The id class specified by type does not match the primary key fields of the class

Hello everybody !
I am faced a migrate project problem. I've got a very very very old java ee
project that currently runs on jboss 4 server. I'm trying to migrate it on a
fresh apache tomee installation.

Entity classes was coded like this:

PK class


Box class


Actually this is works on the jboss 4 server installation but when i'm
trying to start it on apache tomee I got the following error :



I need to keep the @ManyToOne relation inside the PK class. Does someone
know an issue in order to help me ?

Tanks a lot :)



--
View this message in context: http://openjpa.208410.n2.nabble.com/The-id-class-specified-by-type-does-not-match-the-primary-key-fields-of-the-class-tp7586109.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: The id class specified by type does not match the primary key fields of the class

Posted by Joe_DAMS <or...@kizux.fr>.
Rick,

Sorry, I failed my copy/paste, this is the whole exception:


In
http://openjpa.markmail.org/thread/bqjomb4mtqj66p2p#query:+page:1+mid:zcxl7qjlqfgv3iwi+state:results

The author said "openjpa.jdbc.SynchronizeMappings=validate did the trick!"
so I tried to change it in my persistence.xml file but without good results
:(

I also read : "The fields of a compound ID class should be one of the
following types : any Java primitive type; any primitive wrapper type;
java.lang.String; java.util.Date;java.sql.Date." That why I tried to change
my entities but same problem.

Thanks for your help



--
View this message in context: http://openjpa.208410.n2.nabble.com/The-id-class-specified-by-type-does-not-match-the-primary-key-fields-of-the-class-tp7586109p7586116.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: The id class specified by type does not match the primary key fields of the class

Posted by Rick Curtis <cu...@gmail.com>.
Joe -

First off, the exception that I assume you meant to post isn't showing up?
Second, the patch I posted wasn't for you to modify your Entities. The
important part of that patch is a code fix to the OpenJPA runtime. I
believe this is an OpenJPA code bug and I wanted to get others to take a
look at it. I'll try to bug someone else to review the patch today.

Thanks,
Rick


On Thu, Mar 20, 2014 at 5:34 AM, Joe_DAMS <or...@kizux.fr> wrote:

> Hello Rick,
> Ty for your answer.
>
> I tried to update my entities like mentionned in your link (Not same
> entities inside my first post but same problem):
>
> Entity with embeddedId
>
>
> Embeddable class
>
>
> And persistence.xml
>
>
> But always got this log message:
>
>
> Are there any solutions to fix it ?
> Ty ! (I'm copying this reply to SO)
>
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/The-id-class-specified-by-type-does-not-match-the-primary-key-fields-of-the-class-tp7586109p7586114.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>



-- 
*Rick Curtis*

Re: The id class specified by type does not match the primary key fields of the class

Posted by Joe_DAMS <or...@kizux.fr>.
Hello Rick,
Ty for your answer.

I tried to update my entities like mentionned in your link (Not same
entities inside my first post but same problem):

Entity with embeddedId


Embeddable class


And persistence.xml


But always got this log message:


Are there any solutions to fix it ?
Ty ! (I'm copying this reply to SO)



--
View this message in context: http://openjpa.208410.n2.nabble.com/The-id-class-specified-by-type-does-not-match-the-primary-key-fields-of-the-class-tp7586109p7586114.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: The id class specified by type does not match the primary key fields of the class

Posted by Rick Curtis <cu...@gmail.com>.
Joe -

As I mentioned on your SO post, it appears that this problem(or a very
similar one) was reported a (nubmer of times?) long time back[1] but was
never resolved. Attached below is a code fix for trunk along with a unit
test, could I get some additional eyes on this change as I'm not 100%
confident that the change is correct.

Thanks,
Rick

[1]
http://openjpa.markmail.org/thread/zbjghovmx3u7hdjy#query:+page:1+mid:bqjomb4mtqj66p2p+state:results
http://openjpa.markmail.org/thread/bqjomb4mtqj66p2p

On Wed, Mar 19, 2014 at 9:03 AM, Joe_DAMS <or...@kizux.fr> wrote:

> Hello everybody !
> I am faced a migrate project problem. I've got a very very very old java ee
> project that currently runs on jboss 4 server. I'm trying to migrate it on
> a
> fresh apache tomee installation.
>
> Entity classes was coded like this:
>
> PK class
>
>
> Box class
>
>
> Actually this is works on the jboss 4 server installation but when i'm
> trying to start it on apache tomee I got the following error :
>
>
>
> I need to keep the @ManyToOne relation inside the PK class. Does someone
> know an issue in order to help me ?
>
> Tanks a lot :)
>
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/The-id-class-specified-by-type-does-not-match-the-primary-key-fields-of-the-class-tp7586109.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>



-- 
*Rick Curtis*