I have two tables / entities in the database with the following attributes:
Car (code, plate, color)
Accessory (code, description).
public Carro buscarCarroComAcessorio(Long codigo) {
return (Carro) em.createQuery("select c from Carro...
I have the following query in JPQL
FROM User u INNER JOIN FETCH u.enderecos e WHERE u.id =:id ORDER BY e.id DESC
A user can have more than ten addresses, so we want to bring only ten addresses and if the user wants, he loads ten times.
I...
I'm developing a system with java + jpa + mysql
but now I have a question that I still can not find the answer ...
Given the tables and entities below, I would like to set up a jpql to perform the following query in native SQL:
SELECT * FROM p...
I am having a question regarding table joins, I have a sales class the same as Customer, Buy, ProductList. I would like to make a report with product name, customer name, product value and date of purchase only I do not have the slightest idea h...
How can I search the associative table?
There are two entities, Person and Time. From where I created the associative Person_Time that has id_people and id_time.
My goal is to list all the id_time of a certain people_id
Next error:
HTTP...
Hello
I have a JPQL query, with count :
public Long quantidadeFaturasAbertasAssinante(Integer idAssin){
return manager.createQuery("select count(f) from Fatura f where f.dataLiquidacao IS NULL and f.assinante.id = :ass", Long...
I have five entities (Quotation, Sector, Partner, Items and Leads), where the user will select a quotation and sector and the list of all items related to this sector will appear along with the items that have already been posted ( if any).
I...
Hello,
I would like to know an elegant way to make a custom query using JPA .
Basically I want to run the query and return it to an object list, but usually it will be a query with N tables and only with the fields I will need.
I und...
Talk the guys! I'm grating here in my TCC and need some help.
I know the problem that I am must be very silly, but I do not have much knowledge. I searched everywhere, JPQL documentation and everything, but I could not solve it.
I need to log...