[hibernate-dev] @Entity and inheritance with annotations

Steve Ebersole steve at hibernate.org
Wed Mar 14 16:17:32 EDT 2012


Can someone help me understand whether this is valid annotation mapping:

@Entity
class A {
}

@Entity
class B extends A {
}

?

My understanding was that an @Entity extending an @Entity had to specify 
an inheritance strategy?  And that this example is really the point of 
@MappedSuperclass:

@MappedSuperclass
class A {
}

@Entity
class B extends A {
}


-- 
steve at hibernate.org
http://hibernate.org



More information about the hibernate-dev mailing list