Questions tagged as 'jpa'

1
answer

Field Calculated JPA Spring Boot

I'd like help finding a calculated field. The problem is that it involves relationships. I need to calculate the total of a Sale with multiple Selling Items (products). The partial total per Sales Item (product price * quantity) is calculated...
asked by 10.07.2016 / 00:01
0
answers

Hibernate JPA hangs

When executing the persistence to generate the tables in the database, netbeans blocks the outputs in this    Oct 26, 2016 3:11:05 PM org.hibernate.dialect.Dialect INFO:   HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect I ca...
asked by 26.10.2016 / 19:16
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
1
answer

Native query count does not return the same type in SQL Server and H2

Hello, I have a native query that does a simple count of records in a table: public Long contar() { String sql "SELECT count(*) FROM Order"; Query query = query.createNativeQuery(sql); // return... } In the system, we...
asked by 07.08.2018 / 21:47
0
answers

Error in the project downloaded from github with JBoss 7.1.1

I downloaded a github project (Project fj25-financas-web - Caelum) and added this project to JBoss 7.1.1. When I run it, these errors occur: 16:07:15,515 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start...
asked by 23.11.2015 / 19:16
1
answer

How to get the final SQL from JPA using NamedQueries

How to get the SQL that is being executed by JPA when we use a createNamedQuery. I would like to have SQL executed to understand where the query problem is: Calling NameQuery EntityManager em = JPAUtil.getEntityManager(); Query quer...
asked by 15.09.2015 / 02:28
0
answers

JPA + EclipseLink - Lazy Loading with EntityManager closed

I'm using EclipseLink as a JPA provider in a Java SE project. I have already set up weaving correctly to allow Lazy Loading. Unlike Hibernate (which launches LazyInitializationException), EclipseLink can get the proxy of a LAZY relationship,...
asked by 19.09.2015 / 01:18
1
answer

JPA / Hibernate problem with concurrency and persistence in JRE

I'm working on a project to create a simple server running on Java SE. I am using JPA + Hibernate to perform persistence, however concurrent routines are a problem. I'm wasting a lot of time trying to solve the problems generated by Hibernate wi...
asked by 16.04.2015 / 05:50
1
answer

Relationship between composite key classes → error: not mapped to a single property

I have a VARIANCE class that has a compound key (FK_T, FK_F, FK_F_VARIACAO). Two of these primary key fields (FK_F, FK_F_VARIACAO) are also foreign key to the FARIA table, in a ManyToOne relationship @ManyToOne(fetch = FetchType.LAZY) @JoinCol...
asked by 08.04.2015 / 21:41
2
answers

Cache Problem - Saving Bank Data to Java System

I have a system developed in Java using JPA, Hibernate, Primefaces. When I write system registry it reflects in the MySQL database normally, so far OK, but when I do unlike the database (register or change) in the application with several F5 it...
asked by 08.05.2015 / 20:36