I’ve a class Foo, which have an @Entity and @Table annotation, and an other class, Bar, which extends Foo.
Are the annotations on the Bar class? If not, can I force that?
Thanks a lot!
Sam.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Annotations are not inherited.
You can read more here: http://fusionsoft-online.com/articles-java-annotations.php
Some other references:
https://stackoverflow.com/a/1644135/1001027
and
https://stackoverflow.com/a/4745820/1001027
Exceptions are annotations which its declaration is annotated with @Inherited.