Criteria API query fails
Clash Royale CLAN TAG #URR8PPP Criteria API query fails I'm new at Criteria and can not understand the next thing. I've got entities with сonnection between each others User: //...fields... @OneToOne(fetch = FetchType.LAZY, mappedBy = "user") private Document document; Document: //...fields... @OneToOne(fetch = FetchType.LAZY) @PrimaryKeyJoinColumn private User user; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "doc_type_id", nullable = false) private DocType docType; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "citizenship_id", nullable = false) private Country country; DocType: //...fields... @Column(nullable = false, length = 5) private String code; Country: //...fields... @Column(nullable = false, length = 5) private String code; I need to find user with a document that contains the docCode (DocType.code) and citizenshipCode (Country.code). Dao: //private final EntityManager em; public List<User> filterUser(U...