Questions tagged as 'jpa'

1
answer

I can not connect Jpa with PostgreSql at all

I'm trying to connect to postgresql , however, without success. My application will be a jsf application and so I'm using persistence. <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com...
asked by 15.04.2014 / 03:56
1
answer

Partial object update / Do not update null values with JPA

I'm using JPA for a webservice, and I'm using Merge to update, but it updates all my object values, is there any way to perform a partial update of it? Example, only change values that are not null?     
asked by 08.09.2017 / 15:34
2
answers

Problem with EntityManager and JPA

I have a problem here that says entitymanager is closed ... I took a look at the net to follow the same model, but here it is wrong ... this is my entitymanager method private EntityManager getEntityManager(){ EntityManagerFactory factory...
asked by 07.07.2016 / 20:17
1
answer

JPA error hibernate = foreign key is returning null

After much research, without success, I decided to post my doubts. I'm using JPA / Hibernate and I have two tables: a Pessoa and a Funcionário . The error occurs when I save my data, the foreign key pessoa_id is empty,...
asked by 01.07.2016 / 21:16
1
answer

What is the (real) utility of the javax.persistence.Transient annotation?

The @Transient annotation serves to inform JPA that that attribute is not mapped to the table and / or should not be persisted. In addition, after the entity that has annotated attributes with @Transient is persisted, these attributes...
asked by 09.11.2017 / 16:36
1
answer

How to turn this query into a JPQL?

I have the following query in the postgres database: select * from trabalha_projeto tp inner join Empregado e on e.matricula = tp.empregado How does it transform it into a JPQL query? I'm having a hard time returning values: First: not...
asked by 05.04.2016 / 03:33
1
answer

JPA / Hibernate Entity with Collection for itself

Hello, I have an entity named menu on my system. A menu can be a child of another menu and so on. The table has the following structure: Theentityismappedasfollows:@Entity@NamedQuery(name="Menu.findAll", query="SELECT m FROM Menu m") public...
asked by 02.02.2016 / 14:11
3
answers

How to create tables when starting Sisitema with JSF and JPA?

Well, how do I get the system started when the tables are created automatically? The way my system is, tables are only created when some kind of bank access is done. For example in the login screen just press the button log that the tables are c...
asked by 11.10.2016 / 15:11
1
answer

Temporary table that hibernate creates

I'm using JPA and Hibernate 4.3.11 when running a simple application To test the connection to Firebird 2.5 Hibernate is generating A temporary table with the HT _ start. Example: created the Customer table and generated Hiberna...
asked by 21.08.2015 / 19:20
1
answer

JPA / Primefaces - Add / Remove records from a child table

I have a problem with a cadastral panel. There is a store network registry in which I am taking care of the implementation. I can normally insert and remove dataTable items, but this is not reflected in the base in the burning process - when...
asked by 30.11.2015 / 20:14