rsql-jpa-specification
rsql-jpa-specification copied to clipboard
Using distinct creating the specification fails with composite keys
Hi,
I just found out that for entities with composite keys, the generated query fails. For instance:
@Entity
@Table(name = "offices")
public class Office implements Serializable {
@EmbeddedId
private OfficeId id;
...
@Embeddable
@EqualsAndHashCode
public static class OfficeId implements Serializable {
@Column(name = "entity")
private String entity;
@Column(name = "code")
private String office;
}
}
This entity will generate the following query when using pagination:
select distinct count(distinct office0_.entity, office0_.code) as col_0_0_
from offices office0_
which obviously fails in Oracle since count
does not support two arguments...