Should l use bidirectional relations or not?

2011-03-23 Thread LongkerDandy
Hi Is there a best practice or something, that when should I use bidirectional relations? Currently I let openjpa to generate DB tables, is that OK for production? Thanks LongkerDandy

MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Marc Logemann
Hi, i want to create metamodel classes during build time. So i did that: see the compilerarg feature. The other stuff was already in my build But i dont see any results. I see no classes being generated somewhere. I also dont see any

Re: OpenJPA Date Proxy serialization problem when using entities with GWT

2011-03-23 Thread Michael Dick
I haven't had a chance to look at your example application, but I think we need to make some changes to the way we handle proxies. Currently there's no way to prevent proxies from being inserted. It's not intuitive when they will be inserted, and they can be tough to remove. What I'd propose is to

Re: Should l use bidirectional relations or not?

2011-03-23 Thread Michael Dick
Hi, It's hard to come up with an all encompassing guide for bidirectional vs unidirectional relationships, since this will depend on your application to a large extent. I find a bidiriectional relationship more intuitive so I use them unless I have a good reason to make them unidirectional. That's

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Marc Logemann
Hmmm. I dont find the service definition file in any of the openjpa jars. According to specs, the file should be named: META-INF/services/javax.annotation.processing.Processor I cant find such a file anywhere. Am i wrong? --- regards Marc Logemann http://www.logemann.org http://www.logentis.d

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Rick Curtis
Try adding a dependency on "openjpa". I'm guessing that the services file[1] isn't packaged in any of your dependencies.? [1] META-INF/services/javax.annotation.processing.Processor Thanks, Rick On Wed, Mar 23, 2011 at 7:26 AM, Marc Logemann wrote: > Hi, > > i want to create metamodel classes

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Rick Curtis
> openjpa-parent\openjpa\target\openjpa-2.1.0-SNAPSHOT.jar from my build environment has it. I also see the file in openjpa-all-2.1.0-SNAPSHOT.jar. Thanks, Rick On Wed, Mar 23, 2011 at 8:45 AM, Marc Logemann wrote: > Hmmm. I dont find the service definition file in any of the openjpa jars. >

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Marc Logemann
Thats what i gussed at the same time (and sent to the list) as you can see ;-) I will check my deps. I dont want to inlcude "openjpa" as a whole because i want to leave out unneeded clutter. But one thing is weird. The class "AnnotationProcessor6" which is the main actor in this game is in openj

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Michael Dick
Hi, The services file was intentionally moved under OPENJPA-1622. It's not clear from the JIRA why it was moved, but my guess is that it was causing problems with the aggregate jars or OSGi. I'm not sure that's a lot of help. If you try manually

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Rick Curtis
>If you try manually adding the services entry, do the metamodel classes get generated correctly? Perhaps you could try? Thanks, Rick On Wed, Mar 23, 2011 at 8:59 AM, Michael Dick wrote: > Hi, > > The services file was intentionally moved under > OPENJPA-1622

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Marc Logemann
Hi. thx for pointing out the -processor thingy. This works basically and i dont have to worry what kind of jar to include or to check where the service file is (the openjpa team should really think about putting it to openjpa-persistence.jar again). So i see a lot of metamodel classes got gene

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Rick Curtis
Marc - Can you narrow down the Entity which is having the problem so we can write a unit test? Thanks, Rick

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Marc Logemann
Thats exactly what i am trying the last 10 minutes but its not that easy because he doesnt process alphabetically or something. In fact i have more than 30 entities which are not processed. One of those is the problem of course. the thingy doesnt reveal very much. I just see many lines like th

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Marc Logemann
one more thing. You have something like this in the second process() method: private boolean process(TypeElement e) { catch (Exception e1) { logger.error(_loc.get("mmg-process-error", e.getQualifiedName()), e1); return false; } finally { ... This is cool i

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Marc Logemann
Puuuh. Its me again. I am gone the hard route and created my own variant of AnnotationProcesso: @Override public boolean process(Set annos, RoundEnvironment roundEnv) { if (active && !roundEnv.processingOver()) { Set elements = roundEnv.getRootElements();

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Marc Logemann
Correction: > With my program, i get a result of course because i dont leave the process on > error ;-) But this is the solution. This is NOT the solution i meant. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 16:38 schrieb Marc Logemann: > Puuu

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Rick Curtis
> > > still a bit clueless > Me too. I just started digging into some of the annotation processor code to see if I can learn something today So when you swallowed the exception everything worked fine? Thanks, Rick

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Marc Logemann
For the time being, how about the following fix in openjpa trunk: /** * The entry point for java compiler. */ @Override public boolean process(Set annos, RoundEnvironment roundEnv) { if (active && !roundEnv.processingOver()) { Set elements = roundEnv.getR

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Rick Curtis
Yes that seems reasonable. I'll get that taken care of sometime this afternoon. I'd like to get another JIRA opened up to investigate the JAXB packageElements problem Thanks, Rick On Wed, Mar 23, 2011 at 10:51 AM, Marc Logemann wrote: > For the time being, how about the following fix in op

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Marc Logemann
Hi, hope i could help a bit in researching this. For now i will use my own variant of AnnotationProcessor6. BTW it was a bit of a mess to create my own version of this class because SourceAnnotationHandler.class has a lot of package private methods which are used by AnnotationProcessor6. So i

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Rick Curtis
> BTW it was a bit of a mess to create my own version of this class because SourceAnnotationHandler.class has a lot of package private methods which are used by AnnotationProcessor6. So i also needed to clone that class too. g. :-) I could easily create a patch to put on top of the existing An

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Marc Logemann
+1 for the patch on AnnotationProcessor6 for the 2.1.x release line. Of course this would make my life easier. I could drop my own variant. I always like using framework classes instead of patched-own-versions. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2

Re: MetaModel creation with -Aopenjpa.generate=true

2011-03-23 Thread Rick Curtis
Marc - Give this[1] patch a shot. If you can help me come up with a test Entity model that exposes this problem I have a pretty good chance of being able to get it into 2.1.1. [1] http://people.apache.org/~curtisr7/patches/annotation_processor_patch.jar Thanks, Rick On Wed, Mar 23, 2011 at 11:2

Transient One to One

2011-03-23 Thread sam . squire
Hello there, I have a persisted field that contains the PK of another entity. It is not mapped properly and is filled manually. The objects this PK refers to are all loaded elsewhere. The mappedBy seems to only apply to inverse relations. Is there a way I can add a Transient OneToOne field tha

Re: Transient One to One

2011-03-23 Thread Kevin Sutter
Maybe I'm just being dense this afternoon, but I'm not following what PK relationships you are trying to map. Can you provide any type of pictures, even cryptic stick diagrams would help. And, exactly is your goal? Thanks. Kevin On Wed, Mar 23, 2011 at 6:41 AM, wrote: > Hello there, > > I ha

Re: OpenJPA Date Proxy serialization problem when using entities with GWT

2011-03-23 Thread Prashant Bhat
I don't know much about the benefits of using proxies, but in our particular usage, all proxies should be removed when the entity is detached/serialized. Then we can use entities directly in GWT avoiding DTOs and also with this, client side will not have dependency on OpenJPA at runtime. Regards,