JPAContainer<X.class UNION Y.class> containerBoth

The title seems confused lol…

I’d just like to show in my array the elements from X.class UNION elements from Y.class
(on those column names : Who,What,Where)

here is my ‘abstract’ class that I will extend on my child classes:

@Entity
@Cacheable(true)
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING)
public class Historique implements Serializable{
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    protected Long id;

    @NotNull
    @Size(max = 100)
    protected String Who;

    @NotNull
    @Size(max = 500)
    protected String What;

    @NotNull
    @Temporal(TemporalType.TIMESTAMP)
    protected Date When;

HistoriqueX.class

@Entity
@Cacheable(true)
@DiscriminatorValue("X")
public class HistoriqueX extends Historique {

    private static final long serialVersionUID = 1L;
    
    @ManyToOne
    @NotNull
    private X x;

    public X getX() {
        return x;
    }

    public void setX(X x) {
        this.x = x;
    }
    
}

So at the moment i’m able to show my data from X in a table :

JPAContainer<HistoriqueDemandeAval> containerHisto = JPAContainerFactory.makeJndi(HistoriqueDemandeAval.class);
      
        containerHisto.addNestedContainerProperty("x.sejour.id");
        
        containerHisto.addContainerFilter(new Compare.Equal("x.sejour.id", sejourId));
        containerHisto.applyFilters();
       
        Table tableHisto = new Table("Historique", containerHisto);
     
        tableHisto.setVisibleColumns(new Object{"when", "what", "who"});
        tableHisto.setColumnHeaders(new String{"Date", "Action", "Author"});
        tableHisto.setColumnHeaderMode(ColumnHeaderMode.EXPLICIT);

But my absolute goal is to make a UNION of those same elements (who,what,who) with the HistoriqueY.class (which is comparable to my HistoriqueX.class)