Hi Folks,
I'm wondering if there's a nice way to solve my problem.
I have an abstract BaseEntity that have this inside:
Code:
@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
@JoinColumn(name="entity_id")
@org.hibernate.annotations.Where(clause = "discriminator='Alias'")
@OrderBy("startDate DESC")
private List<Discontinued> discontinuedEntries = new ArrayList<Discontinued>(0);
I have a class Alias that extends BaseEntity.
If you look inside the code section, I do a where clause that have discriminator='Alias'
I would like to be able to set that value according to my child class. Is there a nice way to do that, or I have to move this variable declaration inside of my Alias class.
thank!