Issues mapping numerous tables to a single entity?

2009-12-04 Thread KARR, DAVID (ATTCINW)
In Hibernate and JPA, I'm used to looking at scenarios where I map a single table to a single entity, along with relationships to other entities with various multiplicities. I'm now looking at a situation where I'm going to need to develop a JPA mapping for a pretty large collection of entities, w

RE: Why does the enhancer create a PROTECTE no-args constructor by default?

2009-12-04 Thread KARR, DAVID (ATTCINW)
> -Original Message- > From: Michael Dick [mailto:michael.d.d...@gmail.com] > Sent: Friday, December 04, 2009 1:54 PM > To: users@openjpa.apache.org > Subject: Re: Why does the enhancer create a PROTECTE no-args > constructor by default? > > Hi David, > > The JVM will create a no-arg cons

Re: Why does the enhancer create a PROTECTE no-args constructor by default?

2009-12-04 Thread Michael Dick
Hi David, The JVM will create a no-arg constructor if you have no other constructors. The spec requires a no-arg constructor so that the persistence provider can create an empty instance. OpenJPA uses it via some tricky generated code (bytecode insertion). As for why it's protected instead of pub

Can a "native" query get/set the timezone from a Calendar?

2009-12-04 Thread KARR, DAVID (ATTCINW)
I noticed in the doc that OpenJPA doesn't support storing or retrieving the timezone value, just the Date portion, even for a TIMESTAMPTZ column (although it doesn't mention that last part). The doc for EclipseLink says something similar, but it simply says that you have to use "native SQL" in ord

RE: Why does the enhancer create a PROTECTE no-args constructor by default?

2009-12-04 Thread KARR, DAVID (ATTCINW)
> -Original Message- > From: Rick Curtis [mailto:curti...@gmail.com] > Sent: Friday, December 04, 2009 12:31 PM > To: users@openjpa.apache.org > Subject: Re: Why does the enhancer create a PROTECTE no-args > constructor by default? > > David- > > Per the JPA spec -- > > The entity class

Re: Why does the enhancer create a PROTECTE no-args constructor by default?

2009-12-04 Thread Rick Curtis
David- Per the JPA spec -- The entity class must have a no-arg constructor. The entity class may have other constructors as well. The no-arg constructor must be public or protected. ...so if your Entity doesn't have one, OpenJPA will do it for you. -- Thanks, Rick On Fri, Dec 4, 2009 at 1:29 P

Why does the enhancer create a PROTECTE no-args constructor by default?

2009-12-04 Thread KARR, DAVID (ATTCINW)
I'm reading the OpenJPA doc, and I see that the enhancer creates a protected no-args constructor if there is no public one. Why exactly does it do that? What is the point of creating a protected constructor instead of letting the JVM create the public one? The doc only says that it does this, no

Re: openJPA with EJB3 MySQL on WAS7

2009-12-04 Thread Kevin Sutter
Hi, Kind of strange. OpenJPA has many, many examples of persistent operations against various databases, including MySQL. All without the behavior that you are seeing. A couple of things jump out at me... o How is your dao constructor setting the values on the fields? Since you are using prop

RE: openJPA with EJB3 MySQL on WAS7

2009-12-04 Thread Russell Collins
Just a quick question. Is the table already created or are you trying to use OpenJPA to create the table? -Original Message- From: kpsuk [mailto:keithsec...@yahoo.co.uk] Sent: Friday, December 04, 2009 9:32 AM To: users@openjpa.apache.org Subject: openJPA with EJB3 MySQL on WAS7 Havin

Re: Setter not working for detached object

2009-12-04 Thread Rick Curtis
Tao - Can you post a simple testcase demonstrating the problem? -- Thanks, Rick On Thu, Dec 3, 2009 at 3:38 PM, Javatao wrote: > > Hi, Experts, > > I am having an issue with detached object in OpenJPA. > > Setter method of relationship field does not work. > Setter method of primitive field w

openJPA with EJB3 MySQL on WAS7

2009-12-04 Thread kpsuk
Having a little trouble with openJPA persiting with MySQL, whilst new rows are being created for each em.persist(dao) the rows are bring populated with 'NULL' values for each column! I get no error in my logs and debugging shows that the property values are there right upto the em.persist(dao) li

Re: Out of bounds exception with fetch plan

2009-12-04 Thread Daryl Stultz
On Fri, Dec 4, 2009 at 3:40 AM, Srinivasan Krishnamoorthy < srinivasan.kr...@live.com> wrote: > > Hi Daryl, > Did you get a solution to this problem... We are also facing exactly the > same issue.. > > No, my work around was to not use fetch plans and use "left join fetch" in my query. I posted m

Re: Out of bounds exception with fetch plan

2009-12-04 Thread Srinivasan Krishnamoorthy
Hi Daryl, Did you get a solution to this problem... We are also facing exactly the same issue.. My query is something like.. "select DISTINCT o from Organisation o where o.typeFlag=0 and o.name like :name". The entity Organisation shares many OneToMany relations with other entities. (some ar

Re: Out of bounds exception with fetch plan

2009-12-04 Thread Srinivasan Krishnamoorthy
Hi Daryl, Did you get a solution to this problem... We are also facing exactly the same issue.. My query is something like.. "select DISTINCT o from Organisation o where o.typeFlag=0 and o.name like :name". The entity Organisation shares many OneToMany relations with other entities. (some ar