Getting the persistence unit name from an EntityManagerFactory

2008-05-04 Thread roger.keays
Does OpenJPA have any tricks we could use to get the persistence unit name which was used to create an EntityManager{Factory}? Cheers, Roger -- View this message in context: http://www.nabble.com/Getting-the-persistence-unit-name-from-an-EntityManagerFactory-tp17044912p17044912.html Sent from

table prefixes without DBDictionary.getValidTableName(..)?

2008-04-30 Thread roger.keays
Hi, To implement automatic table prefixing I've written a DBDictionary with a custom getValidTableName(..) method. Unfortunately this only seems to be called if there is no @Table(name="X") annotation or equivalent xml. Is there a way to do this for _all_ table names? Thanks in advance, Roger

Re: Different schema per entity manager?

2008-04-06 Thread roger.keays
to pre-build a serialized dump of the MetaDataRepository, which > includes compiled queries. > > -Patrick > > On Mon, Mar 31, 2008 at 6:52 PM, roger.keays > <[EMAIL PROTECTED]> wrote: >> >> Hi all, >> >> Does anybody know if it is possible to configure

Different schema per entity manager?

2008-03-31 Thread roger.keays
Hi all, Does anybody know if it is possible to configure OpenJPA EntityManagers to use a specific database schema. ATM I'm using openjpa.jdbc.Schema, but this only allows configuring the schema on EntityManagerFactories. Alternatively, is it possible to configure a shared QueryCompilationCache a

RE: Primary key field generation with postgres

2008-03-27 Thread roger.keays
Here is my patch for OpenJPA 1.0.2. You might prefer to move the code to the superclass though. Index: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java === --- openjpa-jdbc/src/main/java/org/apache/openj

RE: Primary key field generation with postgres

2008-03-27 Thread roger.keays
Marc LaPierre wrote: > > It seems like JPA isn't finding your sequence in the ves schema. > > Are you sure that your sequence exists in Postgres? > Are you able to run "select currval('user_id_seq')" from the sql > console? > Was this ever resolved? In this case SELECT currval('user_id_seq')

Re: Annotation for foreign key constraints on subclass join columns

2008-03-05 Thread roger.keays
roger.keays wrote: > > Does OpenJPA have an annotation to specify foreign key constraints for > subclass tables using JOINED inheritance? I'm aware of the mapping > defaults config options, but would like to put this info into annotations > if possible. > Okay, using @

Annotation for foreign key constraints on subclass join columns

2008-03-05 Thread roger.keays
Hi, Does OpenJPA have an annotation to specify foreign key constraints for subclass tables using JOINED inheritance? I'm aware of the mapping defaults config options, but would like to put this info into annotations if possible. Thanks in advance, Roger -- View this message in context: http:/

RE: ON DELETE CASCADE causes OptimisticLockingException

2008-03-05 Thread roger.keays
as "fixed" but I still see that behavior. I ended up > manually doing the deletes when required instead of relying on cascade. > > Marc > > > -Original Message- > From: roger.keays [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 05, 2008 7:55 AM >

RE: ON DELETE CASCADE causes OptimisticLockingException

2008-03-05 Thread roger.keays
still see that behavior. I ended up > manually doing the deletes when required instead of relying on cascade. > It surprises me that openjpa can do this and still be TCK compatible. > > Marc > > > -Original Message- > From: roger.keays [mailto:[EMAIL PROT

Re: ON DELETE CASCADE causes OptimisticLockingException

2008-03-05 Thread roger.keays
roger.keays wrote: > Since upgrading to 1.0.0, all my CASCADE DELETE foreign key actions cause > an OptimisticLockingException when you delete the owning entity. This > happens even if @ForeignKey describes the delete action correctly. > This is still a problem in 1.0.2 with pos

ON DELETE CASCADE causes OptimisticLockingException

2007-12-12 Thread roger.keays
Hey, Since upgrading to 1.0.0, all my CASCADE DELETE foreign key actions cause an OptimisticLockingException when you delete the owning entity. This happens even if @ForeignKey describes the delete action correctly. e.g @Entity A { @OneToMany(cascade=CascadeType.ALL, mappedBy="a") List b; }

annotating primary key foreign actions for subclasses

2007-12-12 Thread roger.keays
Hi all, I'm having difficulty with the order OpenJPA is executing SQL statements. Using @ForeignKey for relationships has solved one problem, but it still gets stuck because I have a cascade action on the keys for my subclasses (using joined inheritence). Is the an annotation I can use to tell o

Re: WHERE clauses with ORDER BY subclass field (fixed)

2007-12-12 Thread roger.keays
roger.keays wrote: > > > > roger.keays wrote: >> >> I've noticed that in 1.0.0, 1.0.1 and 1.1.0-SNAPSHOT I cannot combine >> WHERE and ORDER BY if they both use subclass fields. This wasn't a >> problem in 0.9.7 > Correction: this hasn't

Re: WHERE clauses with ORDER BY subclass field

2007-12-12 Thread roger.keays
roger.keays wrote: > > I've noticed that in 1.0.0, 1.0.1 and 1.1.0-SNAPSHOT I cannot combine > WHERE and ORDER BY if they both use subclass fields. This wasn't a problem > in 0.9.7 Correction: this hasn't changed since 0.9.7. The problem has appeared since I switch

WHERE clauses with ORDER BY subclass field

2007-12-11 Thread roger.keays
I've noticed that in 1.0.0, 1.0.1 and 1.1.0-SNAPSHOT I cannot combine WHERE and ORDER BY if they both use subclass fields. This wasn't a problem in 0.9.7 e.g. these queries work (id is a subclass field, uuid is a superclass field): SELECT i FROM News i ORDER BY i.id; SELECT i FROM News i WHERE

org.apache.openjpa.persistence.ArgumentException: -1

2007-12-11 Thread roger.keays
Does anybody recognise this error in openjpa 1.0.0? org.apache.openjpa.persistence.ArgumentException: -1 org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:808) org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:769) org.apache.openjpa.kernel.QueryImpl.ex

Re: Programmatically pagination does NOT work with OpenJPA 1.0.1

2007-12-05 Thread roger.keays
same problem on postgres 7.4. broken in 1.0.1 but works in 1.0.0 will there be a 1.0.2 release to fix these sorts of things? cheers, rog Marc Prud'hommeaux wrote: > > Frank- > > This sounds like something that was fixed in the trunk for revision > #584463: > >

Re: Can openjpa map a Map?

2007-10-23 Thread roger.keays
ps_1_N_map.html#join_simple_simple Thanks for the idea. Roger On Oct 23, 2007, at 7:08 PM, roger.keays wrote: > > Hi All, > > AFAICT the JPA spec doesn't allow mapping collections of basic types > (sheesh!). Does OpenJPA have any extensions to allow this? It was >

Can openjpa map a Map?

2007-10-23 Thread roger.keays
Hi All, AFAICT the JPA spec doesn't allow mapping collections of basic types (sheesh!). Does OpenJPA have any extensions to allow this? It was possible in JDO so should still be somewhere in OpenJPA. Roger P.S. Congrats on the 1.0 release! -- View this message in context: http://www.nabble.co