RE: Get primary key from persistent bean

2006-12-11 Thread Pinaki Poddar
This is a major hole in the JPA spec if you ask me. Once upon a time, there was a spec called JDO. It had a API javax.jdo.JDOHelper.getObjectId(Object pc); I think it got left out while copying ;) Pinaki Poddar BEA Systems 415.402.7317

Re: Get primary key from persistent bean

2006-12-11 Thread Marc Prud'hommeaux
Dain- Note that you could always introspect on the class and look for the @Id annotation, and get the value of the Field/Method on which the annotation resides. This is pretty heavy-handed, and doesn't work for XML mappings, but it is one possible way to do this without making

Re: Get primary key from persistent bean

2006-12-11 Thread Craig L Russell
Hi Dain, I've never seen an @Entity without an @Id annotation. I don't believe it is a valid JPA mapping without an @Id. That said, it's not required to be named Id. So are you writing a framework or sample code? For a framework, it would be nice to be portable. For sample code, who

Re: Get primary key from persistent bean

2006-12-11 Thread Dain Sundstrom
On Dec 11, 2006, at 6:03 PM, Craig L Russell wrote: Hi Dain, I've never seen an @Entity without an @Id annotation. I don't believe it is a valid JPA mapping without an @Id. That said, it's not required to be named Id. I'm not using annotations at all. Everything is done in the mappings

RE: Get primary key from persistent bean

2006-12-11 Thread Patrick Linskey
On Dec 11, 2006, at 6:03 PM, Craig L Russell wrote: Hi Dain, I've never seen an @Entity without an @Id annotation. I don't believe it is a valid JPA mapping without an @Id. That said, it's not required to be named Id. I'm not using annotations at all. Everything is done in the

Re: Get primary key from persistent bean

2006-12-11 Thread roger.keays
Dain Sundstrom wrote: This is a major hole in the JPA spec if you ask me. +1 ! I don't use @Id either -- View this message in context: http://www.nabble.com/Get-primary-key-from-persistent-bean-tf2796004.html#a7827429 Sent from the open-jpa-dev mailing list archive at Nabble.com.