Re: detachment of fetch-groups doesnt work

2009-04-08 Thread Marc Logemann
is this worth a JIRA ? --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 08.04.2009 um 23:50 schrieb Tedman Leung: just as additional information, this is also true about any lazy PersistentCollection too. I found that if I accessed the collection while it is in

Re: Identity class and parent/children entity relationship

2009-04-08 Thread Paul Copeland
Hi Fay - Found my error here - my case now works on 1.2.1. I had a mapping error that caused the reentrant flush exception -- this is probably not the problem fixed by JIRA-1004. This is the story - I have a class with a OneToMany relationship to itself (parent has a collection of children

Re: detachment of fetch-groups doesnt work

2009-04-08 Thread Tedman Leung
just as additional information, this is also true about any lazy PersistentCollection too. I found that if I accessed the collection while it is in an attached state the values are available, but as soon as it becomes detached the collection becomes null even if I had just accessed it prior to

Re: inefficient mapping

2009-04-08 Thread Marc Logemann
Hi, the queries are not slow. There are just a hell lot of queries but you are right. THe problem is that i ve done EAGER fetching quite extensively and it makes no sense to load all positions when i just want to show a list of orders in the first place. So i really need to invest some mo

Re: Pattern for unmodifiable Collections

2009-04-08 Thread Paul Copeland
Thanks for the feedback. Judes suggestion looks promising for ManyToMany case but could complicate my forward mapping. Pinaki - Your suggestion sort of works ... because it creates a new unmodifiableList every time getMyPcList() is called -- there is a constructor invoked inside Collections.

Re: Eclipse Plugin for OpenJPA

2009-04-08 Thread Daryl Stultz
On Wed, Apr 8, 2009 at 2:37 PM, Rick Curtis wrote: > > Daryl - > > Did you ever hear back from the MyEclipse people? > They have acknowledged the feature request but no other announcement. Here's the thread: http://www.myeclipseide.org/index.php?name=PNphpBB2&file=viewtopic&t=23019&highlight= -

Re: Eclipse Plugin for OpenJPA

2009-04-08 Thread Pinaki Poddar
In case this post missed your attention... http://n2.nabble.com/Voluteer-to-build-OpenJPA-Eclipse-plugin-tc2493580.html#a2493580 Daryl - Did you ever hear back from the MyEclipse people? -Rick On Mon, Feb 23, 2009 at 1:31 PM, Pinaki Poddar wrote: > > > What is the status of this request?

Re: Eclipse Plugin for OpenJPA

2009-04-08 Thread Rick Curtis
Daryl - Did you ever hear back from the MyEclipse people? -Rick On Mon, Feb 23, 2009 at 1:31 PM, Pinaki Poddar wrote: > > > What is the status of this request? > I just submitted it in response to your message today. I'll let you know if I hear anything. -- Daryl Stultz __

Re: inefficient mapping

2009-04-08 Thread Paul Copeland
Marc - If all the join columns are indexed it should not be too slow. You could put the same SQL into an "explain" analysis tool to investigate it. For a start run the SQL outside JPA and see how many rows are returned. Notice you are getting an orderpos, an order, a boxes, and two adresse

Re: Where to get general JPA help

2009-04-08 Thread Daryl Stultz
On Wed, Apr 8, 2009 at 1:11 AM, Paul Copeland wrote: > Are there other forums or lists that are good for asking general JPA > questions (not specifically OpenJPA)? > I found a General JPA forum on Nabble ( http://www.nabble.com/JPA-General-f27110.html). The activity was pretty light but I did ge

Re: Multiple join fetches

2009-04-08 Thread Daryl Stultz
On Tue, Apr 7, 2009 at 7:02 PM, Pinaki Poddar wrote: > > Hi Daryl, > > Ah, so modifying the fetch plan is for the lifetime of the em? I think I > like that. > > Yes. But there is more to it. > Thanks Pinaki (and Jay). -- Daryl Stultz _ 6 Degrees Software and

Re: Does OpenJPA replace Collections?

2009-04-08 Thread Paul Copeland
Pinaki - I tried your suggestion of not initializing the value of myPcList and I get a null pointer exception when adding to an empty list. I noticed your example was for Property access and Russell (and I) were talking about Field access. Do you agree that it is necessary to initialize an

Re: Does OpenJPA replace Collections?

2009-04-08 Thread Paul Copeland
Thanks Pinaki - I think you are saying that at some point the proxy object does replace the local List. Is that right? I have seen that model - if (myPcList == null) myPcList = new ArrayList() - in various examples (not sure where now). Thanks for clearing that up. But then Craig Russell

detachment of fetch-groups doesnt work

2009-04-08 Thread Marc Logemann
Hi, with OpenJPA 1.2.0 i am having some problems detaching attributes which are in a fetch-group. My persistence.xml is: My Domain class header: @FetchGroups({ @FetchGroup(name="posDetail", attributes={ @FetchAttribute(name="deliveryAddresses") }) }) public class Order {

Re: Pattern for unmodifiable Collections

2009-04-08 Thread Judes Tumuhairwe
I think making both join-columns not insertable and not updatable should work.On the promotion (ownerSide) object @JoinTable(name = "promotion_pc", schema="public", joinColumns = {...@joincolumn(name = "promotion_id", referencedColumnName = "id", insertable=false, updatable=false)},

Re: Where to get general JPA help

2009-04-08 Thread Kevin Sutter
Hi Paul, Not really. We do have a JPA 2.0 expert group forum for the current spec activity, but that mailing list is for topics specifics to the JPA 2.0 spec that is under development (http://jcp.org/en/jsr/detail?id=317). Hopefully, the members of the OpenJPA community can answer general JPA que

Re: Does OpenJPA replace Collections?

2009-04-08 Thread Craig L Russell
On Apr 8, 2009, at 2:18 AM, Craig L Russell wrote: On Apr 7, 2009, at 11:10 PM, Paul Copeland wrote: Can OpenJPA replace a Collection when it is loaded? With the code below when the list is initially empty you need to create a List (ArrayList) so you can add elements to it. When I persi

Re: Does OpenJPA replace Collections?

2009-04-08 Thread Pinaki Poddar
Hi, According to JPA spec: "If there are no associated entities for a multi-valued relationship of an entity fetched from the database, the persistence provider is responsible for returning an empty collection as the value of the relationship." That is what OpenJPA does. So the application do n

Re: Pattern for unmodifiable Collections

2009-04-08 Thread Pinaki Poddar
Hi, > Is there a way to prohibit direct updates to a perisistent Collection? What exactly happens if you wrap the list as unmodifiable as follows? @ManyToMany (mappedBy="ownerSide", fetch=FetchType.LAZY, cascade=CascadeType.PERSIST) private List myPcList; List getMyPcList() {

Re: Does OpenJPA replace Collections?

2009-04-08 Thread Craig L Russell
On Apr 7, 2009, at 11:10 PM, Paul Copeland wrote: Can OpenJPA replace a Collection when it is loaded? With the code below when the list is initially empty you need to create a List (ArrayList) so you can add elements to it. When I persisted new objects on the ManyToOne side and added them

Re: inefficient mapping

2009-04-08 Thread Marc Logemann
Paul, thx for pointing out that @ElementJoinColumn is definitely not needed here. I removed them and at least everything works but unfortunately as slow as before. My example was a simple one because i dont wanted to show of the real one, but now since i really dont know what to do, i mus