Questions tagged as 'criteria'

1
answer

Subquery in select clause with Criteria JPA

I was researching how to make a subquery in the select clause with Criteria of a select of this type: SELECT tabela1.*,tabela2.*, (SELECT MAX(tabela5.AtrDatatabela5) FROM .Tabela3 AS tabela3 INNER JOIN Tabela4 AS tabela4 ON tabela4.AtrId...
asked by 29.03.2016 / 14:23
0
answers

Criteria: Subquery with multiple columns

I have the problem and I can not resolve it. How to turn this query into NHibernate Criteria. SELECT ordid, prodid, qty FROM item WHERE (prodid, qty) IN (SELECT prodid, qty FROM item WHER...
asked by 28.05.2015 / 22:08
1
answer

Querying in a List (IN) - Predicate and Specification - JPA CriteriaBuilder

Hello, I have to create a dynamic query based on the following scenario in a RESTFUL application using Springboot and JPA (I'm using JpaSpecificationExecutor): I have two entity classes (Entity), the first is that of products: Produto Long i...
asked by 06.05.2018 / 20:23
1
answer

Select hibernate criteria with unmapped entity

How do I make a select, using the criteria and bring an unmapped entity, would be multiple joins, and sometimes bring certain fields and others not.     
asked by 13.12.2016 / 20:06
2
answers

How to do this consultation with JPA?

I would like two solutions to this question, one using a normal typedquery and another using the criteria because of its great versatility for the code. Here is my query: TypedQuery<Pessoa> query = em.createQuery("SELECT a FROM...
asked by 18.08.2016 / 15:26
1
answer

VBA Excel - Index Match with two conditions

I have a spreadsheet with multiple tabs. On the first tab I have the following table: Intab2,typetheclientandtype,andIwanttoreturntheID.ForthisIamusingthefollowingcodeinVBA:tipo=ActiveCell.Offset(0,-1).Valuecliente=Range("D5").Value ActiveCell....
asked by 18.07.2018 / 20:50
1
answer

Search using Criteria with WHERE, AND and OR

I'm trying to do a search using Criteria , the search would be this: SELECT * FROM lefacil.pap_produto a WHERE (a.marca='Fabber Castell' or a.marca='Tilibra') AND (a.quantidadeCores='12 Cores' or a.quantidadeCores='24 Cores'); I already re...
asked by 01.12.2017 / 19:30
1
answer

Distinc Criteria Hibernate java

I have the following context: class Entidade1 private Long id; private int commentId; private int userId; class Entidade2 private Long id; private String descricao; - I have the following criteria Criteria criteria = persistence.create...
asked by 29.11.2017 / 14:02
1
answer

AND and OR Operators

I recently started using the Criteria API because I need to make queries that would be very complex with HQL. How do I use the AND and OR operators in queries with the Criteria API?     
asked by 29.10.2015 / 03:50
1
answer

Criteria query with expression contains in the field of a ManyToOne entity

Considering the two entities below: /** * @ORM\Table(name="cliente") * @ORM\Entity */ class Cliente { /** * @ORM\Column(name="id_cliente", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ priva...
asked by 27.08.2015 / 13:28