Questions tagged as 'jpa'

3
answers

Hibernate vs EclipseLink

Both persistence frameworks implement JPA. 1 - Is there a difference between the two? 2 - Which is the best in performance? 3 - How do the two implement the same specification, after developing a complete application is it possible to c...
asked by 21.03.2017 / 15:34
1
answer

Hibernate - duplicate key value violates unique constraint

I have the following problem: Person: @Entity @Table(name="tb_pessoa", schema="public") @Inheritance(strategy = InheritanceType.JOINED) public class Pessoa implements Serializable { private static final long serialVersionUID = 1L; @I...
asked by 16.06.2015 / 23:42
2
answers

jpql filter without using the filter of primefaces (with its own method)

Changed to probable solution but still not working, it seems that the line with ajax is not updated. <h:body> <h:form id="formTableProd"> <ui:composition template="/templates/master.xhtml"> <ui:define name="con...
asked by 24.07.2014 / 03:00
1
answer

Annotation @ManyToMany in the same entity / table

My Class: @Entity public class Report extends AbstractModel implements IReport { @Column private String nome; @Column private byte[] arquivoJrxml; @ManyToMany private List<Report> subReports; My question: My Report class has s...
asked by 25.01.2018 / 11:50
1
answer

Performace in native query

Good morning, I'm on a project where I have to build charts based on queries made in a Postgres database. This bank has a BI framework and the tables have an average 40 million lines . The queries I'm supposed to make at the bank are be...
asked by 01.08.2016 / 15:16
1
answer

Using Criteria for sorting

In the system I am developing I am trying to use the criteria to be able to execute a query which I am not able to work with jpql, so I tried to execute according to the material that had been getting to that code. CriteriaBuilder crite = em.ge...
asked by 28.06.2017 / 20:40
1
answer

Problem persisting object with @ManyToOne - JPA / Hibernate

I have the following problem: I can save / persist the two objects below, but JPA is not binding the ID of the DeclaracaoImportacao in the class / entity ID column. Follow the code @Entity @Table (name = "declaracaoimportacao") publi...
asked by 22.09.2016 / 21:12
2
answers

Problems removing element @ManyToMany with @JoinTable

I'm having problems deleting a @ManyToMany relationship in JPA. In short, I have 3 tables: USER, PERMISSION, and USER_PERMISSION that is the relationship of the previous ones, the relationship is N to N. The problem is that I'm not sure how to r...
asked by 10.01.2016 / 04:40
1
answer

Entities marked FETCH LAZY are returning "null" even after a call to the GET method

Hello, good morning, friends, Why are my entities marked as fetch lazy returning "null" even when they are invoked via a get? What I learned in several courses is that when I make the first call to a get method, hibernate would load the da...
asked by 19.11.2018 / 12:22
1
answer

try / catch not "catching" Exception

I'm using JPA and was trying to create an EntityManager, and was testing some expcetions treatments in a class of mine. However, I'm having a problem, that the exception is not being caught by the catch. public static boolean openConnection(...
asked by 03.08.2014 / 07:44