0

I am using JPA with QueryDSL.
Here are my entities with single table inheritance strategy.

@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "type")
public abstract class Parent {
    private int parentId;
    private LocalDateTime createdAt;
    ...
}

@Entity
@DiscriminatorValue("a")
public class A extends Parent {
    ...
}


@Entity
@DiscriminatorValue("b")
public class B extends Parent {
    ...
}


@Entity
@DiscriminatorValue("c")
public class C extends Parent {
    ...
}

I have to write a query with QueryDSL that inquires A and B in order of createdAt value.
If I can't do this with QueryDSL what can I do?

Roger
  • 7
  • 3

0 Answers0