The issue is this, I’m extending a generic framework and applying it to an specific proyect, the framework works with Spring and Hibernate, here I have two classes, GenericClient and SpecificClient, they are both entities, and SpecificClient inherits from GenericClient.
GenericClient is part from the framework and I can’t modify it, since this class doesn’t declares @Inheritance(strategy = InheritanceType.JOINED) the only type of inheritance type that can be used is InheritanceType.SINGLE_TABLE because this is the default value of the annotation.
Currently my code is working with @Inheritance(strategy = InheritanceType.SINGLE_TABLE) being declared in SpecificClient, even though it is not the root of the inheritance tree.
Due to version issues I have to find the way to use InheritanceType.JOINED, the good thing is that SpecificClient will always be the last class of the inheritance tree, but can be different in different projects.
- Is there any way in that I can inject the annotation
InheritanceType.JOINEDin the parent class? - Is there any way that the parent class can be declared in such a way that according to the needs of specific projects you can use one kind of inheritance of the other?
You could use XML to define the mapping of this inheritance tree. Here’s the relevant section of the documentation.