Re: @ManyToOne not optional -> nullable

2010-07-13 Thread Jean-Baptiste BRIAUD -- Novlog
Hi Michael, It works exactly as you explained. I didn't spot that difference between optional and nullable before. Thanks. On 13 juil. 2010, at 20:09, Michael Dick wrote: > > Hi Jean-Baptiste, > > I think what you want is > @Column(nullable=false) instead of marking it as optional=false. >

Re: JPA genereates non-exist id column in the select statement

2010-07-13 Thread Fay Wang
You can try @PersistentCollection - Original Message From: llchen To: users@openjpa.apache.org Sent: Tue, July 13, 2010 10:22:57 AM Subject: Re: JPA genereates non-exist id column in the select statement Sorry I forgot to mention that I am using JPA 1.0 and therefore I can't use @E

Re: JPA genereates non-exist id column in the select statement

2010-07-13 Thread Fay Wang
Hi, Making the superclass an embeddable should not prevent it from being subclassed by other entities. Regards, Fay - Original Message From: llchen To: users@openjpa.apache.org Sent: Tue, July 13, 2010 3:42:26 AM Subject: Re: JPA genereates non-exist id column in the select statem

Re: Are there any tools which will map from Hibernate to OpenJPA XML mapping files?

2010-07-13 Thread Michael Dick
I don't know of a tool that works from the hbm.xml files directly, but you can use OpenJPA's ReverseMappingTool to generate an orm.xml file and .java files for your entities (ignore these) based on the database. There's a starting point in the manual http://openjpa.apache.org/builds/latest/docs/

Re: @ManyToOne not optional -> nullable

2010-07-13 Thread Michael Dick
Hi Jean-Baptiste, I think what you want is @Column(nullable=false) instead of marking it as optional=false. There's some blurring of the lines in OpenJPA, but generally @Column should be used to indicate database constraints, and the @ManyToOne annotation for ORM behavior. @Column will be us

Re: JPA genereates non-exist id column in the select statement

2010-07-13 Thread llchen
Sorry I forgot to mention that I am using JPA 1.0 and therefore I can't use @ElementCollection tag. Lule -- View this message in context: http://openjpa.208410.n2.nabble.com/JPA-genereates-non-exist-id-column-in-the-select-statement-tp5282960p5288555.html Sent from the OpenJPA Users mailing lis

Re: OpenJPA MySQL performance overhead

2010-07-13 Thread idan
Thank you very much for the information! I will test again according to the info you gave me. Idan -- View this message in context: http://openjpa.208410.n2.nabble.com/OpenJPA-MySQL-performance-overhead-tp5279410p5288087.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: OpenJPA MySQL performance overhead

2010-07-13 Thread Michael Dick
Also good advice. Here's the link to the ant script (I think this is the right one) : http://openjpa.208410.n2.nabble.com/Ant-based-enhancement-td5065091.html#a5065949 . -mike On Tue, Jul 13, 2010 at 3:52 AM, Jean-Baptiste BRIAUD -- Novlog < j-b.bri...@novlog.com> wrote: > Enhance at build-time,

Re: OpenJPA MySQL performance overhead

2010-07-13 Thread Michael Dick
Hi Idan, I wrote a simple test just for inserts : http://pastebin.com/bbW3RMnp Results from my laptop : DBC insert took: 23042 200 idan INFO [main] openjpa.Runtime - Starting OpenJPA 2.0.0 649 idan INFO [main] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.MySQLDi

@ManyToOne not optional -> nullable

2010-07-13 Thread Jean-Baptiste BRIAUD -- Novlog
Hi, Class A, has one attribute like the following : @ManyToOne(optional = true, cascade = CascadeType.ALL) @JoinColumn(name = "B_ID") private B b = null; Not surprisingly, this is producing, in the table A, a column like the following : B_ID bigint(20) Yes NULL Note that the colum

Re: JPA genereates non-exist id column in the select statement

2010-07-13 Thread llchen
Thanks for your suggestion, I will try that embedable option. But that second entity VoVariableData actually is a super class for onother three entities. If I make that one into a embedable, then the other three will not be able to subclass from it. Lule -- View this message in context: http://

Re: OpenJPA MySQL performance overhead

2010-07-13 Thread Jean-Baptiste BRIAUD -- Novlog
Enhance at build-time, not at run-time. Search the archive, I gave an ant script to do it. I'm not sure what "out of the box" really mean. I suggest you use high volume data and then an average time so you'll have the cruise speed only. I would also ensure any cache is disabled. On 13 juil. 2010

Re: OpenJPA MySQL performance overhead

2010-07-13 Thread idan
Thanks for your reply guys. I'm using an out of the box configuration + DBCP for connection/statements pooling. I'm only measuring the persist/find/remove methods (transaction commit). The only thing i can think of is that i'm currently using a java agent for enhancing my classes. Is there a kn