Changing an entitys table name at runtime.

2007-12-17 Thread ben short
Hi, Suppose that I have a simple entity @Entity @Table ( name = "SimpleEntity") public class SimpleEntity { @Id private Long id; } This entity gets enhanced during my build cycle and the db table is created when i start my application. Is it possible for me at runtime to change the table name

Re: SELECT followed by UPDATE

2007-11-02 Thread ben short
being called in situations where I did not expect them. > > Then I enabled SQL=TRACE, and saw the huge volumes of Updates being > > spuriously triggered. > > > > > > -Marc > > > > > > On 11/2/07, ben short <[EMAIL PROTECTED]> wrote: > > > Out of intere

Re: SELECT followed by UPDATE

2007-11-02 Thread ben short
> Are you using the @PreUpdate or similar tags at all in your classes? > Because that was how I noticed the problem on my end, my @PreUpdate > methods were being called in situations where I did not expect them. > Then I enabled SQL=TRACE, and saw the huge volumes of Updates being > sp

Re: SELECT followed by UPDATE

2007-11-02 Thread ben short
: > I have also asked this question a couple of times now - seeing the > same behavior with 1.0.0. > > -Marc > > On 11/2/07, ben short <[EMAIL PROTECTED]> wrote: > > I am seeing odd behaviour with my application. I do a bunch of query's > > in a transaction a

SELECT followed by UPDATE

2007-11-02 Thread ben short
I am seeing odd behaviour with my application. I do a bunch of query's in a transaction and get the expected results. But looking at the logs I see that my selects are followed by a bunch of update statements, that are updating the records I have just selected. I'm defiantly not doing any updating.

Re: Incorrect DEFERRABLE usage with PostgreSQL

2007-11-01 Thread ben short
I think that [1] covers the other 63 char issue also. [1] https://issues.apache.org/jira/browse/OPENJPA-282 On 11/1/07, Ryosuke IWATA (DM) <[EMAIL PROTECTED]> wrote: > Hi Ben, > > Yes, I noticed it after filing the issue. So I have closed it just now. > I should have be more careful... > > Thank

Re: Incorrect DEFERRABLE usage with PostgreSQL

2007-11-01 Thread ben short
Is this [1] issue the same as what you have reported? [1] https://issues.apache.org/jira/browse/OPENJPA-282 On 11/1/07, Ryosuke IWATA (DM) <[EMAIL PROTECTED]> wrote: > Hi Craig, > > Thank you for the reply. > > I filed a bug in jira : https://issues.apache.org/jira/browse/OPENJPA-426 > > This is

Re: Automatically removing member variable prefix when naming columns.

2007-10-31 Thread ben short
runtime. > > -Patrick > > On Oct 30, 2007 4:27 PM, ben short <[EMAIL PROTECTED]> wrote: > > In the MappingDefaultsImpl class there is a property _defMissing, any > > idea what thats for? > > > > > > On 10/30/07, Patrick Linskey <[EMAIL PROTECT

Re: Automatically removing member variable prefix when naming columns.

2007-10-30 Thread ben short
gt; On Oct 30, 2007 3:43 PM, ben short <[EMAIL PROTECTED]> wrote: > > Hi Patrick, > > > > I managed to get it going... I was trying to get idea to create the > > project from the pom. As you say using mvn idea:idea works much > > better. > > > > Thank

Re: Automatically removing member variable prefix when naming columns.

2007-10-30 Thread ben short
ation. And > I use TeamCity to fire off remote tests and checkins. > > -Patrick > > On Oct 30, 2007 2:54 PM, ben short <[EMAIL PROTECTED]> wrote: > > What IDE do you guys use, as im having a hell of a time getting it to > > work with idea 7 > > > > > >

Re: Automatically removing member variable prefix when naming columns.

2007-10-30 Thread ben short
t; know; I'll create an issue for you. > > -Patrick > > On Oct 30, 2007 2:07 AM, ben short <[EMAIL PROTECTED]> wrote: > > OK I'll give it ago. I assume that you'll need a patch of the changes > > I make. Where is the best place to send it once I'm

Re: Automatically removing member variable prefix when naming columns.

2007-10-30 Thread ben short
ClassMapping cm = (ClassMapping) JPAFacadeHelper.getMetaData(emf, > HungarianNotationFields.class); > // check that the associated FieldMappings in cm have the > right column names > } > } > > -Patrick > > On 10/25/07, ben short <[EMAIL PROT

Automatically removing member variable prefix when naming columns.

2007-10-25 Thread ben short
Hi, I name my class member variables (fields) with the prefix m, such as mId. Is it possible to tell OpenJPA to create the table columns without the m prefix? I know this can be done using the @Column annotation, but it would be nice to be able to set a global flag, like I think you can with hibe

Re: Please help me enhancing my classes

2007-10-24 Thread ben short
Hi, Here is what I have in my pom... Codehaus Snapshots http://snapshots.repository.codehaus.org/ true false apache-snapshots http://peop

Re: SequenceGenerator not using cached ids.

2007-09-25 Thread ben short
Further to this issue.. Running the following code... conn = ds.getConnection(); Statement statement = conn.createStatement(); for ( int i = 0 ; i < 10 ; i++ ) { ResultSet rs = statement.executeQuery("SELECT NEXTVAL('CategoryIdSeq')"); while (rs.next()) { System.out

Re: SequenceGenerator not using cached ids.

2007-09-21 Thread ben short
n the returned > values, though. > > Does anyone know the syntax in Postgres to select a batch of numbers from a > seq? > > -Patrick > > On 9/20/07, ben short <[EMAIL PROTECTED]> wrote: > > My work around was to set the allocationSize property to 1, but that >

Re: SequenceGenerator not using cached ids.

2007-09-20 Thread ben short
My work around was to set the allocationSize property to 1, but that kind of defeats the point of caching the id's. Regards Ben On 9/20/07, Takeichi Kanzaki Cabrera <[EMAIL PROTECTED]> wrote: > I have the same problem using postgresql + openjpa-1.0 and at this > time I have no solution for it. >

Re: SequenceGenerator not using cached ids.

2007-09-20 Thread ben short
<[EMAIL PROTECTED]> wrote: > Hi, > > Have you done any other configuration of the sequence elsewhere? Also, > can you turn SQL and JDBC logging to TRACE and post the logs? > > I think I remember a thread about a similar topic in the last couple > of months, btw. I don

SequenceGenerator not using cached ids.

2007-09-20 Thread ben short
n. I'm using postgresql and openjpa-1.1.0-SNAPSHOT. I have search the JIRA but cant see a bug of this description. Is this a known issue? Regards Ben Short

Re: Queries when creating EntityManager

2007-09-20 Thread ben short
Do you want to turn of the logging of sql? You'll need to set on of the log properties [1] but I'm not sure which one relates to the sql being logged, sorry. You can do this as show below..

Re: ReverseMappingTool not seeing system varables

2007-09-08 Thread ben short
Ok I have it working, by changing ConnectionDriverName to org.postgresql.Driver. Ben On 9/8/07, ben short <[EMAIL PROTECTED]> wrote: > Hi, > > I have been trying to use the reverse mapping tool with the following > command... > > java > -Dopenjpa.ConnectionURL=jdbc:

ReverseMappingTool not seeing system varables

2007-09-08 Thread ben short
db URL is defiantly valid as I can connect using pgAdmin and other java apps. Does anyone have any ideas? Regards Ben Short

Re: Id column = null?

2007-09-06 Thread ben short
Are you doing all your work within a transacion? I wonder if the ids are not being set as ou havent tried to access them within a transaction. On 9/6/07, ben short <[EMAIL PROTECTED]> wrote: > Maybe you could try and load one of the WebPage objects directly > rather than via the WebMo

Re: Id column = null?

2007-09-06 Thread ben short
gt; > ----- Original Message > From: ben short <[EMAIL PROTECTED]> > To: users@openjpa.apache.org > Sent: Thursday, 6 September, 2007 3:13:59 PM > Subject: Re: Id column = null? > > Whats the id column name on the WebPage table? > > On 9/6/07, Xh <[EMAIL PROT

Re: Id column = null?

2007-09-06 Thread ben short
for WebPage does > not. > > Changing GenerationType to AUTO does not solve the problem. > > best regards > Ɓukasz > > - Original Message > From: ben short <[EMAIL PROTECTED]> > To: users@openjpa.apache.org > Sent: Thursday, 6 September, 2007 1:20:59 PM > Su

Re: Id column = null?

2007-09-06 Thread ben short
Try changing to GenerationType to AUTO eg @GeneratedValue(strategy = GenerationType.AUTO) I think that the GenerationType.IDENTITY dosent assign the ids to the rows until its commited to the db, so any relations are written to the db as nulls. Ben On 9/6/07, Xh <[EMAIL PROTECTED]> wrote: > Hi

@SequenceGenerator question

2007-09-05 Thread ben short
the generator again. I'm using postgresql and openjpa-1.1.0-SNAPSHOT. I have search the JIRA but cant see a bug of this description. Is this a known issue? Regards Ben Short

Re: 1.0.0 The type "class" has not been enhanced.

2007-08-30 Thread ben short
that. Regards Ben Short [1] http://maven.apache.org/guides/mini/guide-central-repository-upload.html On 8/29/07, Patrick Linskey <[EMAIL PROTECTED]> wrote: > > Setting openjpa.RuntimeUnenhancedClasses=2 allows the application to > > run. > > Cool; FTR, 2 corresponds to t

Re: 1.0.0 The type "class" has not been enhanced.

2007-08-29 Thread ben short
> this is the @Table annotation used on the AttributeAndValue class. > > > > @Table([EMAIL PROTECTED](columnNames={ > > "mProductInstance, mAttribute", "mValue"})) > > IIRC, OpenJPA does not currently support multi-column unique > constraints. I thi

1.0.0 The type "class" has not been enhanced.

2007-08-29 Thread ben short
Hi, I download the 1.0.0 source and ran mvn install. It built and installed ok. I use either the maven enhance plugin or the ant task to enhance the classes. When I run my simple test app I get the following exception... 32 openjpa INFO [main] openjpa.Runtime - Starting OpenJPA 1.0.0 438 ope

Re: @UniqueConstraint annotation

2007-08-28 Thread ben short
; your environment? > > -Patrick > > On 8/28/07, ben short <[EMAIL PROTECTED]> wrote: > > > > I missed that while looking at the code. > > > > Thanks for the clarification. > > > > Ben > > > > On 8/28/07, Patrick Linskey <[EMAIL

Re: @UniqueConstraint annotation

2007-08-28 Thread ben short
ad of setting > a property. The base impl just returns the default supportsUniqueConstraints > value, but for example, PostgresDictionary overrides > supportsDeferredUniqueConstraints() to simply return false. > > -Patrick > > On 8/28/07, ben short <[EMAIL PROTECTED]&

Re: @UniqueConstraint annotation

2007-08-28 Thread ben short
we introduced two new settings, then we'd need to decide what to > > do if supportsDeferrableConstraints and one of the new settings were in > > conflict. > > > > Certainly we could add a configuration-accessible setting if the need > > arises, though. > > > > > > -Patri

Re: @UniqueConstraint annotation

2007-08-28 Thread ben short
It should be a trivial fix; we just need to update our Postgres > DBDictionary. > > -Patrick > > On 8/28/07, ben short <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I have upgraded to 1.0.0-SNAPSHOT and see a different error.. > > > > 31 open

Re: @UniqueConstraint annotation

2007-08-28 Thread ben short
... > > } > > > > And in XML > > > > > > > > > > TITLE > > > > > > ... > > > > > > For more information see the "Unique Constraints" section [1] >

Re: how to get maven openjpa plugin to enhance

2007-08-28 Thread ben short
Ok heres my setup, as I said I only got this far lastnight so by no means is it 100% correct.. pom.xml http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd

Re: how to get maven openjpa plugin to enhance

2007-08-28 Thread ben short
stopper for me. I appreciate you helping out. > > ben short wrote: > > I only got all this to work last night and don't have the code with > > me.. but my persistance.xml and orm.xml are in > > /src/main/resources/META-INF. > > > > I'll have a lo

Re: how to get maven openjpa plugin to enhance

2007-08-28 Thread ben short
that were suggested and am getting the same exact > error message. Is it because it cannot see my persistence.xml file. > > The persistence.xml file is in the META-INF folder in src/main/resources > > ben short wrote: > > Hi, > > > > I think th

@UniqueConstraint annotation

2007-08-28 Thread ben short
n xml rather than use the annotations to use the UniqueConstraint feature? Regards Ben Short

Re: how to get maven openjpa plugin to enhance

2007-08-28 Thread ben short
Hi, I think that your pluging config is incorrect. Try it as below org.codehaus.mojo openjpa-maven-plugin JPA Enhance process-classes