Questions tagged [criteriaquery]

245 questions
-1
votes
1 answer

How JPA Criteria API works

I'm new and I have an assignment concerning JPA Criteria Queries. I'm trying to understand what exactly means this code. EntityManager em = ... CriteriaBuilder qb = em.getCriteriaBuilder(); CriteriaQuery c =…
Unearthly
  • 121
  • 6
-1
votes
1 answer

How to write JPA criteria query select a with JOIN

I am having a problem on how to write Join and than select from Application so I have to entities Application and Deactivated deactivated has a field: @OneToOne(fetch = FetchType.LAZY) @JoinColumn(name = "application_id") private Application…
Victor M
  • 47
  • 4
-1
votes
1 answer

JPA CriteriaBuilder with IN Clause

I habe Entity Report with "CollectionTable" ReportUser: @Entity class Report { @Column private Short userId; @Column(name = "reportUserId") @ElementCollection(fetch = FetchType.EAGER) @CollectionTable(name = "ReportUser", joinColumns = {…
dkalna
  • 55
  • 3
-1
votes
2 answers

Transform SQL to Hibernate criteria

I am writing a method for retrieving clients with sum of their orders (order.total) higher and less than input values. Criteria criteria = DetachedCriteria.forClass(Clients.class, "cl"); if (clOrdsTtlPrcFrom != -1 && clOrdsTtlPrcTo != -1) { …
Aleksei
  • 165
  • 8
-1
votes
1 answer

CriteriaQuery list of abstract class

I have the classes Order, Article, Car public class Order{ private List
articles; } public abstract class Article{ private int id; } public class Car extends Article{ private String color; } public class Book extends Article{ private…
user1345883
  • 451
  • 1
  • 8
  • 24
1 2 3
16
17