Re: 'Masking' fields in an Entity

2009-03-30 Thread Jay McHugh
Thank you for the additional insight. Switching the DetachState is making things more clear. I had it set to a value of "all" before based on some example (not sure where from though). Here are answers to your questions - Hopefully by the time I finish answering them all, I will have it working.

Re: 'Masking' fields in an Entity

2009-03-30 Thread Pinaki Poddar
Hi, You are correct in detaching the instance with the current fetch plan. In theory, now the detached instance should only have the fields selected by the fetch plan. If that is not happening then verify the following in order 1. Is the instance detached? OpenJPAEntityManager.isDetached(pc)

Re: No table was given for persistent type

2009-03-30 Thread David Leangen
Beautiful! Thank you very much. I am now able to work with this both within Eclipse and without, thanks to your help as well as that of org.apache.openjpa.lib.util.MultiClassLoader. Cheers! =David On Fri, 2009-03-27 at 13:26 -0500, Kevin Sutter wrote: > Use this project instead: http://file

Re: Evicting an embedded object.

2009-03-30 Thread rpalache
Hi Rick, Yes I commented on that post. But then later realized that an embedded object's state can also be persistant. Meaning, If you check this current post, before evict if I check embeddedObject.isPersistent() then it returned true. But after evicting an embedded object the isPersistent

Re: 'Masking' fields in an Entity

2009-03-30 Thread Jay D. McHugh
There was a typo I just noticed. The first line of my email was supposed to read: > I have been banging my head against FetchPlans, and all of my attempts > have returned either an exception -OR- the default plan. Hopefully that didn't cause any confusion. Jay Jay D. McHugh wrote: > Hello agai

Re: Evicting an embedded object.

2009-03-30 Thread Rick Curtis
Ravi - This looks similar to a known problem (See https://issues.apache.org/jira/browse/OPENJPA-453). I see you commented on this JIRA a few weeks back? -Rick Hi, Thanks for looking into this. Please find the attached test case. openJPATestCase.zip A readme.txt file is in the zip that gi

Re: how to store collection of enums as strings

2009-03-30 Thread Paul Copeland
Hi Ted - See example code below On 3/30/2009 9:47 AM, Tedman Leung wrote: Isn't the same thing true that OneToMany should annotate a Collection of Entities? So the Enums would be a field on the ManyToOne side of that kind of mapping. Then you can specify the @Column and @Enumerated annota

Disabling QueryCaching at runtime does not work

2009-03-30 Thread rpalache
An application has a configuration that allows query caching, but is making runtime calls to inform a fetch plan to disable query caching. The bug is that this dynamic no-caching request is being ignored by the query cache executor, which then caches the query regardless. Tried to disable quer

Re: Identity class and parent/children entity relationship

2009-03-30 Thread Nemanja Joksovic
Thanks Fay, I tried it before and it's working fine. But in production environment I need to using stable OpenJPA 1.2.x version (JPA 1.0 specification). Regards, Nemanja J. The workaround is to use MappedById annotation (JPA 2.0 spec) in Openjpa trunk: @Entity public class Child implements

Re: 'Masking' fields in an Entity

2009-03-30 Thread Jay D. McHugh
Hello again, I have been banging my head against FetchPlans, and all of my attempts have returned either an exception of the default plan. In an attempt to really restrict what is comming back I came up with the following: OpenJPAEntityManager em = OpenJPAPersistence.cast(entityManager); FetchP

Re: Identity class and parent/children entity relationship

2009-03-30 Thread Fay Wang
The workaround is to use MappedById annotation (JPA 2.0 spec) in Openjpa trunk: @Entity public class Child implements Serializable { @EmbeddedId @Column(name = "id", unique = false, nullable = false) private ChildId childId; @MappedById("parent") @ManyToO

Re: Is JPA 2 going to have something like JAXBs @XmlJavaTypeAdapter ?

2009-03-30 Thread Craig L Russell
Hi Ryan, Your proposed addition to the JPA specification is very clean and even though it's late, I'd say it's worth considering. Craig On Mar 30, 2009, at 9:54 AM, Ryan Fogarty wrote: Hi Jeremy, I really appreciate your response; it's good to know there is a workaround for OpenJPA (as

Re: Identity class and parent/children entity relationship

2009-03-30 Thread Nemanja Joksovic
Thank you very much. Nemanja J. The second problem is a known problem. I will open a JIRA for it. --- On Sun, 3/29/09, Nemanja Joksovic wrote: > From: Nemanja Joksovic > Subject: Identity class and parent/children entity relationship > To: users@openjpa.apache.org > Date: Sunday, March 29

Re: Is JPA 2 going to have something like JAXBs @XmlJavaTypeAdapter ?

2009-03-30 Thread Ryan Fogarty
Hi Jeremy, I really appreciate your response; it's good to know there is a workaround for OpenJPA (as I understand it, Hibernate can also do this as part of its proprietary interface). I just sent an 11th hour comment to the JSR317 committee (jsr-317-comme...@jcp.org) regarding the issue. B

Re: how to store collection of enums as strings

2009-03-30 Thread Tedman Leung
> How does your original example of ManyToMany annotation on a Collection > of Enums actually work? My understanding is that for ManyToMany both > sides must be persistent Entities. So therefore the ManyToMany is > mapping the join table, not the Enum. yes oddly enough it actually does wor

Re: Is JPA 2 going to have something like JAXBs @XmlJavaTypeAdapter ?

2009-03-30 Thread Jeremy Bauer
Ryan, I agree, this would be a useful feature to have standardized by the JPA specification. My guess is that it would be too late to try to get something into JPA 2.0, but one could recommend this feature for inclusion in a future version of the spec. Pinaki and Kevin (cc'd) participate in the

Re: Identity class and parent/children entity relationship

2009-03-30 Thread Fay Wang
The second problem is a known problem. I will open a JIRA for it. --- On Sun, 3/29/09, Nemanja Joksovic wrote: > From: Nemanja Joksovic > Subject: Identity class and parent/children entity relationship > To: users@openjpa.apache.org > Date: Sunday, March 29, 2009, 5:33 AM > Hi all, > > I've

can generate DDL connectionless from cmdline but not ant task

2009-03-30 Thread Heather Sterling
Hi, I consulted a bunch of the existing information regarding generating DDL without a db connection. I was able to successfully do this with 1.2 from the cmdline, but it still tries to get a connection when I execute from the ant task. Both are pointed at the same persistence.xml and I have n

Re: how to store collection of enums as strings

2009-03-30 Thread Paul Copeland
Hi Ted - A few more questions to fill out my knowledge - How does your original example of ManyToMany annotation on a Collection of Enums actually work? My understanding is that for ManyToMany both sides must be persistent Entities. So therefore the ManyToMany is mapping the join table, not

Is JPA 2 going to have something like JAXBs @XmlJavaTypeAdapter ?

2009-03-30 Thread Ryan Fogarty
I use @XmlJavaTypeAdapter a lot to manipulate our data model for classes that just don't naturally fit into an XML model (like custom containers and the sort). Seems to be one of the most intuitive and powerful tools in JAXBs toolbox but I can't find anything like it in JPA 1 or 2. For instance, I