openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schmidt <fakod...@googlemail.com>
Subject Re: identity class IllegalArgumentException
Date Wed, 09 Jun 2010 20:54:25 GMT
Pinaki, thx for your answer and your interest

non-composite works fine, queries are working fine, mapped superclass
works fine... So no problems till now.

I always used BigInteger for primary keys, long will not work because
Scala does not support basic types. But I will do some tests, what
Scala makes out of class Long and if this works with OpenJPA (and
Javas reflection API).

I remember that I had some problems doing compile time enhancements
(with Scala and Maven) but I will retry this tomorrow.

Christopher

On Wed, Jun 9, 2010 at 9:53 PM, Pinaki Poddar <ppoddar@apache.org> wrote:
>
> Hi Christopher,
>  "Simple" as opposed to "non-composite" identity in JPA sense. Simply
> speaking, it's a primary key that corresponds to single persistent field or
> property of the entity class. So what I was asking was does the following
> work:
>  public class A {
>    @Id
>     private long id;
>   }
>
> or
>  public class B {
>    @Id
>     private BigDecimal id;
>   }
>
>
> Thank you for the stack trace.
>
> Few things to note
>
> 1. at
> ...ReflectingPersistenceCapable.pcNewObjectIdInstance(ReflectingPersistenceCapable.java:277)
>        at
> org.apache.openjpa.util.ApplicationIds.create(ApplicationIds.java:421)
>
>   Apparently the Java persistent domain classes are being "enhanced" at
> runtime. If the environment permits, I will highly recommend to switch to
> build-time enhancement [1].
>   OpenJPA manages user domain objects by "enhancing" their bytecode. While
> this bytecode enhancement  can be triggered via different means and at
> different time points -- the reliable/stable means is to run a
> post-compilation command on the normally compiled classes to "enhance" them.
>   Build-time enhancement will help to focus on the "real" Scala-JPA
> integration issues rather than chasing OpenJPA problems introduced by
> non-build-time enhancement techniques.
>
>  If switching to build-time enhancement does not resolve the problem, (or
> even otherwise) please post further outcome/progress of your interesting
> project.
>
> [1]
> http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_pc_enhance_build
>
>
>
>
>
>
> -----
> Pinaki
> --
> View this message in context: http://openjpa.208410.n2.nabble.com/identity-class-IllegalArgumentException-tp5159262p5160183.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Mime
View raw message