I am working on a JPA project. I have an ExportProfile
object:
@Entity public class ExportProfile{ @Id @GeneratedValue private int id; private String name; private ExtractionType type;
ExtractionType
is an interface implemented by several classes, each for a different type of extraction, these classes are single. Thus, type
is a reference to a singleton object. I do not have an ExtractionType
table in my database, but I need to save the extraction type of my export profile.
How can I save an ExportProfile
object using JPA while maintaining a reference to the type
object?
NOTE. The number of ExtractionType
implementations is undefined, since a new implementation can be added at any time. I also use Spring, can this help?
source share