Re: OneToMany and Lazy fetch : is it still broken?

2009-01-05 Thread ruslan
In my case one-to-many collection wasn't populated until I explicitly enhanced entity classes. http://n2.nabble.com/Foreign-key-field-doesn't-set-populated-in-descendant-class-in-Join-Inheritance-td1520977.html#a1520977 http://n2.nabble.com/Re%3A-Foreign-key-field-doesn't-get-populated-in-descenda

Re: OneToMany and Lazy fetch : is it still broken?

2009-01-05 Thread ruslan
Not really. OpenJPA uses workaround mechanism to "enhance" entities without external PCEnhancer task but as one of OpenJPA's commiters said here "it is not ready for prime-time". So in my case lazily fetched one-to-many relations didn't work in certain cases (with class inheritance in my case). On

Re: OneToMany and Lazy fetch : is it still broken?

2009-01-05 Thread ruslan
Hi Andrei, Did you enhance your entity classes? It might not work because of that. On Mon, Jan 5, 2009 at 2:37 PM, Andrei Tchijov wrote: > > I have seen few posts about this issue. It looks like I am experiencing it > as > well. > > I am using OpenJPA 1.2/Java 1.5/MySQL 5.0. I am enchanting my

Re: Foreign key field doesn't get populated in descendant class in Join Inheritance

2008-11-25 Thread ruslan
By the way I forgot to ask something. I noticed that you guys do not detach from VM in InstrumentationFactory.getInstrumentation(). Is it intentional ? In Sun's sample of late binding of javaagent they detach from JVM. -- View this message in context: http://n2.nabble.com/Re%3A-Foreign-key-field

Re: Foreign key field doesn't get populated in descendant class in Join Inheritance

2008-11-25 Thread ruslan
Kevin Sutter wrote: > > I would suggest turning this option off and using either static > enhancement > via the PCEnhancer tool or using the -javaagent option like you suggested. > If both of these problems are resolved by using one of this preferred > enhancement processes, then I would suggest

Re: Foreign key field doesn't get populated in descendant class in Join Inheritance

2008-11-24 Thread ruslan
Kevin Sutter wrote: > > I see that you are using LAZY fetch type, so that's a hint to us not to go > out and load the Book entities until they are requested. But, if these > Book entities were previously persisted and still available in the > persistent context, they can be filled in. The LAZY

Re: How do I use commandline PCEnhancer (OpenJPA 1.3) ?

2008-11-23 Thread ruslan
Will it repack my JAR after instrumenting all classes ? I decided to try ANT route and it's not going very well either. Here is what I tried: http://pastebin.com/m4a2e7199 I'm trying to instrument only one class as experiment, but it can't find it even though I explicitly defined classpath :(

How do I use commandline PCEnhancer (OpenJPA 1.3) ?

2008-11-22 Thread ruslan
Sorry guys, it's me again. I'm still converting my Hibernate project to OpenJPA so I will continue to entertain everybody in this mailing list. Could you please help me with commandline PCEnhancer ? I have a problem with one entity in my project. Everything is running under Tomcat. So my entity h

Handling nesting exceptions (EntityExistsException)

2008-11-22 Thread ruslan
Guys, could you please suggest me how you handle attempt to add duplicate into table in your application? What's the best way of finding exception which I can handle when thrown exception consist of bunch of other nested exceptions? Here is example: http://pastebin.com/m3505bcbc As you can see

Re: AW: How to make compound id via @EmbeddedId

2008-11-21 Thread ruslan
That is surprise to me. Thanks a lot for pointing out. I didn't know that @Embeddable classes have to be registered in persistence.xml because I thought it's necessary only for entity classes. Perhaps it would be great to mention it in section "1.4. Embeddable" of the documentation. Another inter

Modification of documentation

2008-11-20 Thread ruslan
Guys, I want to propose change something in documentation a little bit by modifying source code sample here . So in the line public long order; // same type as order's identity we may mention that n

How to make compound id via @EmbeddedId

2008-11-20 Thread ruslan
Hi guys. Could you please tell me how to create compound id field using embedded class ? I tried this (which works in Hibernate): package db; import javax.persistence.*; import java.io.Serializable; @SuppressWarnings({"ALL"}) @Entity @Table(name = "electronic_books_data") public class Electronic

Foreign key field doesn't set populated in descendant class in Join Inheritance

2008-11-19 Thread ruslan
Hi guys. I have a question about join table inheritance. In few words the problem is that foreign key field doesn't get set in descendant class in Join Inheritance. I have 3 tables: authors, books and electronic_books. Here is SQL script: http://pastebin.ca/1259927 AuthorsEntity: http://pastebi

Foreign key field doesn't get populated in descendant class in Join Inheritance

2008-11-18 Thread Ruslan
x27;. Initially I thought ALL fields of base class won't be set but it turns out ElectronicBooksEntity.id and ElectronicBooksEntity.title have valid values. Am I missing something in definition of my descendant class ? Thanks!! / Ruslan