Query on parent’s collection – Hibernate Specification

I have three tables created with Hibernate. Product is the parent while barcodes is a collection end price is a child (one to many) of products. @NotBlank private String ref; @ElementCollection(…

How to join two tables with a group query using Hibernate (5.4) Criteria?

This is my Project Entity: ( Project.java ) @Entity @Table(name = “project”) public class Project implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) …

Hibernate Criteria API join to another table only with id

I am trying to join from one table to another by using the Hibernate Criteria API. The problem is that table Contract has only salesId as defined as long (so no FK). Then I am not sure how to …