How to build a dynamic query which add number of days to date and compare that date with another date using criteria API?
问题 I've got a A table, and a B table. Both JPA entity , A and B classes has joda.time.datetime Persistent Field say retentionDate and lastmodifiedDate respectively. A has one more Persistent Field of type int says days . Now I would like to add number of a.days into a.retentionDate and then compare it with b.lastmodifiedDate using JPA criteria API . A Entity class @Entity @Table(name = "A") @Data @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true)