openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: Get primary key from persistent bean
Date Tue, 12 Dec 2006 02:03:20 GMT
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 cares?

Craig

On Dec 11, 2006, at 5:45 PM, Dain Sundstrom wrote:

> On Dec 11, 2006, at 5:34 PM, Craig L Russell wrote:
>
>> Hi Dain,
>>
>> How about
>>
>> Object pk = bean.getId();
>
> That implies that every persistent bean implements getId().  That  
> would work find for the beans I write but not for beans other  
> write.  This is a major hole in the JPA spec if you ask me.
>
> -dain

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message