users@jpa-spec.java.net

[jpa-spec users] [jsr338-experts] Should IdentifiableType#getId(Class) always return non-null?

From: Matthew Adams <matthew_at_matthewadams.me>
Date: Mon, 23 Jul 2012 08:44:53 -0500

Hi all,

Scenario: entity "app.domain.Profile" extends abstract mapped superclass
"app.domain.AbstractEntity". If AbstractEntity defines a single string
field as its @Id, should the IdentifiableType instance corresponding to
app.domain.Profile guarantee that its getId(Class) method will never return
null?

In other words, is it up to the client of the JPA metamodel to go up the
entity's type hierarchy until it finds the SingularAttribute for the id
field, or should the JPA implementation do that?

Thanks,
Matthew

-- 
mailto:matthew_at_matthewadams.me <matthew_at_matthewadams.me>
skype:matthewadams12
googletalk:matthew_at_matthewadams.me
http://matthewadams.me
http://www.linkedin.com/in/matthewadams