Questions tagged as 'jpql'

1
answer

JPQL JPA - Create a grouped list by date with the sum and profit of all items sold that day

The SQL query below is returning a wrong result for the Delay value field. SELECT DATE(p.dt_pedido) AS barChartLabels, COUNT( DISTINCT p.id) AS qtdPedido, SUM((item.quantidade * item.preco) * p.taxa_compra) AS percentualCompra, SUM(item.quant...
asked by 03.11.2018 / 23:24
1
answer

Working with Date in Mysql, JPA

I'm using JPA and creating an entity to save a date within the database. So far so good, the problem is that I need to display the bank information according to the month of my date . Does it have a way of when to ask JPQL to return only...
asked by 14.08.2017 / 20:11
1
answer

How to do a random search using JPQL script in JPA2

The idea is basically to look for an X number of persisted entities in a random way, and these entities can not be repeated. The question is, can you perform this type of search by creating and executing a JPQL script ?, or is it necessary to im...
asked by 02.10.2014 / 16:23
1
answer

JPQL Order by and LIMIT (JSF and JPA)

I'm having trouble solving a query with JPQL. I want it to work: SELECT * from tab_historico WHERE idPolicial = 1 ORDER BY idhistorico DESC LIMIT 1 My DAO is wrong, where I need to put the query: public Historico obterMarket() { St...
asked by 23.09.2018 / 20:15
1
answer

Query in JPQL / HQL query

I need to query in HQL and I have this Hibernate entity. @Entity @Table(name = "TB_TIPO_DOCT", schema = "FEP") @NamedQueries({ @NamedQuery(name = "TbTipoDoct.findAllDocumentosLiberados", query = "SELECT t FROM TbTipoDoct t WHERE t.cdSitu...
asked by 30.08.2018 / 21:25
1
answer

help with nativeQuery

I tried to do the query uasndo expression constructors and jpql, but jpql does not eceita subqueryes and I'm trying to do with nativeQuery. Is it possible? I'm getting an error message. Would anyone know why? The query is as follows: Str...
asked by 07.07.2017 / 18:23
0
answers

Dependent check box

I have a problem and would like to know if you can help me. I have a CRUD that registers cycles, these cycles can have many courses. What I wanted to do exactly, is to validate the selectsOneRadios when registering an issue, that is choos...
asked by 01.11.2015 / 20:55
1
answer

Problem with JPQL using JSF

I'm following a Java EE 7 book with JSF, PrimeFaces and CDI by Thiago Farias. In my persistence.xml, following the book, I have only the definition of my datasource, as follows: <?xml version="1.0" encoding="UTF-8"?> <persistence v...
asked by 13.09.2015 / 03:23
1
answer

doubt about JPQL

Hello everyone. I am using JPQL in my project to create some database access commands and I am having difficulty manipulating the language. I'm posting the snippet of code I'm having trouble with. public Usuario porNome(String nome) { Usua...
asked by 21.10.2016 / 04:56