Lazy load for detached entities

2007-09-11 Thread Evgeny Shepelyuk
Hello ! Is there any way to access fields marked with lazy fetching for detached entities. Im having some code like @Entity @Table(schema = "public", name = "users") public class UsersEntity { private Integer userid; private List orders; @OneToMany(cascade = CascadeT

Re: Lazy load for detached entities

2007-09-11 Thread Patrick Linskey
Hi, Lazy loading is not available for detached entities -- by definition, they are no longer associated with the database. You can, however, control whether OpenJPA returns null or throws an exception when an unloaded field is accessed. If you want to be able to lazily access a field after a tra

Re: Lazy load for detached entities

2007-09-11 Thread Marc Logemann
Hi, i am also working in a highly detached environment because of auto- detachment when giving data to a different layer (questionable approach i know, but i dont need to inject persistenceManagers everywhere then). So i also have this "lazy loading" problem. I circumvent this kind of issu

Re: Lazy load for detached entities

2007-09-11 Thread Evgeny Shepelyuk
Hi, i am also working in a highly detached environment because of auto- detachment when giving data to a different layer (questionable approach i know, but i dont need to inject persistenceManagers everywhere then). So i also have this "lazy loading" problem. I circumvent this kind of issue by us

RE: Lazy load for detached entities

2007-09-11 Thread Gene Wu
to support lazy load base on your code. Just change the order. Load the object before you close em(this is the context needed for lazy load). EntityManagerFactory emf = Persistence.createEntityManagerFactory("pu1"); EntityManager em = emf.createEntityManager(); OrdersEntity order = em.find(Orders

Re: Lazy load for detached entities

2007-09-11 Thread Marc Logemann
This is of course the manual way but fetch-groups are smarter in my oppinion But i am using Kodo and it might be that fetch groups are not supported in openJPA but i think it is -- regards Marc Logemann [blog] http://www.logemann.org [busn] http://www.logentis.de Am 11.09.2007 um 11

Re: Lazy load for detached entities

2007-09-11 Thread Evgeny Shepelyuk
11.09.07 в 12:17 Gene Wu в своём письме писал(а): to support lazy load base on your code. Just change the order. Load the object before you close em(this is the context needed for lazy load). EntityManagerFactory emf = Persistence.createEntityManagerFactory("pu1"); EntityManager em = emf.crea

Re: Lazy load for detached entities

2007-09-11 Thread Evgeny Shepelyuk
This is of course the manual way but fetch-groups are smarter in my oppinion But i am using Kodo and it might be that fetch groups are not supported in openJPA but i think it is Yes fetch groups are suppored in OpenJPA. So can u give some basic use case for using fetch groups ? -- Be

Re: Lazy load for detached entities

2007-09-11 Thread Evgeny Shepelyuk
Hi, Lazy loading is not available for detached entities -- by definition, they are no longer associated with the database. You can, however, control whether OpenJPA returns null or throws an exception when an unloaded field is accessed. If you want to be able to lazily access a field after a tr

openjpa.Enhance message

2007-09-11 Thread Takeichi Kanzaki Cabrera
Hi, finally I could run my example using Java 6 with no problems, but, at runtime I get this message: test_jpa INFO [main] openjpa.Enhance - Creating subclass for "[class test.Person, class test.Sex]". This means that your application will be less efficient and will consume more memory than it

Re: Lazy load for detached entities

2007-09-11 Thread Patrick Linskey
> The idea is that Toplink JPA supports that feature. OpenJPA - no. > Maybe this can be done as some configurable behaviour ? They do, but really, all that they are doing is hiding the open EM. In other words, the objects are not actually really detached yet. What type of application are you buil

Re: openjpa.Enhance message

2007-09-11 Thread Evgeny Shepelyuk
Hi, finally I could run my example using Java 6 with no problems, but, at runtime I get this message: test_jpa INFO [main] openjpa.Enhance - Creating subclass for "[class test.Person, class test.Sex]". This means that your application will be less efficient and will consume more memory than

Re: openjpa.Enhance message

2007-09-11 Thread Takeichi Kanzaki Cabrera
On 9/11/07, Evgeny Shepelyuk <[EMAIL PROTECTED]> wrote: > > This should help you to understand :) > > http://openjpa.apache.org/builds/1.0.0/apache-openjpa-1.0.0/docs/manual/ref_guide_pc_enhance.html > > -- > Best Regards > Evgeny K. Shepelyuk > OK, thank's a lot. I have been searching tod

Re: Non-EE mapping classes?

2007-09-11 Thread Patrick Linskey
Actually, you should be able to call Persistence.createEntityManagerFactory("foo", map), where "foo" is the name of your persistence unit in a META-INF/persistence.xml file. -Patrick On 9/10/07, Gene Wu <[EMAIL PROTECTED]> wrote: > Yes, I think so. and you have to use OpenJPA specified APIs inste

Re: Lazy load for detached entities

2007-09-11 Thread Craig L Russell
Hi Evgeny, The JPA spec is clear on the concept of a detached instance: the instance can be used without access to the underlying database or the persistence context whence it came. The instance can be serialized and used in a different tier entirely. The instance can be used in a complet

Detached Object?

2007-09-11 Thread Chadwick Baatz
I'm new to using JPA, so I might be misinterpreting how the detached object concept should work. The problem I am having is integrating JPA into a service based system. I have an entity A that I would like to share between many different entities (B). There will be time when more than one req

Enhancer Ant Task in Netbeans?

2007-09-11 Thread Stanczak Group
Does anyone have an example of using the enhancer in a NB's ant task. I can't get the one that the docs show to work. I'm not sure what I'm doing wrong. Keeps saying: org.apache.openjpa.util.MetaDataException: MetaDataFactory could not be configured (conf.newMetaDataFactoryInstance() returne

Re: Netbeans tutorial

2007-09-11 Thread Marina Vatkina
Netbeans just've added some support for OpenJPA: http://www.netbeans.org/issues/show_bug.cgi?id=99940. Feel free to try and let them know what needs to be improved. Regards, -marina Mauricio Salatino wrote: Hi there! someone have a tutorial to use OpenJPA with Netbeans?? if someone have the s

Re: Netbeans tutorial

2007-09-11 Thread Mauricio Salatino
thanks a lot! i'll check it out! On 9/11/07, Marina Vatkina <[EMAIL PROTECTED]> wrote: > Netbeans just've added some support for OpenJPA: > http://www.netbeans.org/issues/show_bug.cgi?id=99940. Feel free to try and let > them know what needs to be improved. > > Regards, > -marina > > Mauricio Sala

Want to upgrade Roller to OpenJPA 1.0 but locks up

2007-09-11 Thread Dave
I'm trying to upgrade the Roller 4.0 code base from OpenJPA 0.9.7 to OpenJPA 1.0 but I'm running into a blocking issue. The task that we use to enhance our POJOs is locking up during the build process. There are no error messages or stack traces, but the CPU goes to about 98% (on my core duo Mac

Re: Enhancer Ant Task in Netbeans?

2007-09-11 Thread klaasjan elzinga
My ant script looks like: