I know that I can do something like:
public class AbstractDao<T extends Bean> {
}
In this case, Bean is an class or interface.
I was wondering if is there a way to do this with annotations, like:
public class AbstractDao<T extends javax.persistence.Entity> {
}
Is something like this possible?
Thanks in advance!
Unfortunately, there is no inheritance in annotations, so it's not possible.
Have a look at the answers to the similar question here:
Why is not possible to extend annotations in Java?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With