-
-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Description
when i got @ManyToOne field in @Embeddable class:
@Embeddable
public class AddressEntity {
@ManyToOne
private City city;
with model like
@Entity
public class AddressHistoryEntity {
@Embedded
AddressEntity invoiceAddress;
@Entity
public class AccountEntity {
@OneToMany(cascade = CascadeType.ALL, mappedBy = "account")
private List<AddressHistoryEntity> addressHistory = new ArrayList<>();
quering by attribute on association field in embedable class
List<AccountEntity> result = accountRepository.findAll(RSQLJPASupport.rsql("addressHistory.invoiceAddress.city.name=='Praha'"));
fails with
java.lang.ClassCastException: class org.hibernate.query.sqm.tree.domain.SqmEmbeddedValuedSimplePath cannot be cast to class jakarta.persistence.criteria.From (org.hibernate.query.sqm.tree.domain.SqmEmbeddedValuedSimplePath and jakarta.persistence.criteria.From are in unnamed module of loader 'app')
at io.github.perplexhub.rsql.RSQLJPAPredicateConverter.join(RSQLJPAPredicateConverter.java:201)
at io.github.perplexhub.rsql.RSQLJPAPredicateConverter.findPropertyPathInternal(RSQLJPAPredicateConverter.java:151)
this can be fixed by "joing" embedded property.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels