views:

1263

answers:

2

How can I use "inheritance" in Annotations? What are the advantages of using inheritance in Annotations?

+1  A: 

This is a very general question, but I'd advise taking a look at the following resources:

But the very basic answer to your question is that you should use the @Inheritance annotation, like so:

@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class Flight implements Serializable {
   ...
}
CaptainAwesomePants
Yes because I study to learn it. I'm stranger this subject. My onion is mix. So thank you for resources.
stical
+1  A: 

I would suggest using the @Inheritance annotation over the @MappedSuperclass. We have had issues in the past with @MappedSuperclass being flexible enough for our ongoing maintenance needs.

mattsidesinger