I´m currently working to implement a lib (“Share Project”) for util classes and also some @Entity classes, which I need in all my other projects to avoid duplicate code implementation.
Some @Entity classes I would like to override in my current project (so I can use other properties etc.). Unfortunately inside my “Share Project” I have also in some @Entity classes a reference, like:
@NotNull
@ManyToOne
@JoinColumn(name = "user_fk", nullable = false)
private User user;
In my current project I want to override than e.g. this User @Entity class, like:
@Entity
@Table(name = "user", indexes = { @Index(columnList = "user_id, id_hash") })
public class UserCustom implements Serializable {
But my “Share Project” is not aware in the references, that I would like to use my custom User @Entity class.
I would like to need a generic class for “User” e.g. so my “Share project” is searching in my current project for a @Entity “User”. If it´s not found in my project, it will use the @Entity User class from “Share Project”.
Any ideas?