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
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
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
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
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
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.