Questions tagged as 'jpa'

1
answer

Java Web - remove method Caused by: org.hibernate.MappingException: Unknown entity: java.lang.Integer

Gent, and I'm trying to create a method in which I delete the database record. However, it is giving the following error: Caused by: org.hibernate.MappingException: Unknown entity: java.lang.Integer Code: public void delete(int user)...
asked by 10.12.2017 / 03:35
1
answer

Average Hibernate / SQL of a table with multiple relationships

I have the following tables TABLE1 id value table2 TABLE2 id table3 TABLE3 id And with that, I would like to average TABLE 1, with WHERE in the TABLE 3 parameters with Hibernate / persistence, where my tables are obj...
asked by 01.11.2017 / 18:33
1
answer

Error Returning Query Using Like

I'm trying to do a jpql query with like using JPA. However, it is not working. UserRepository class public class UsuarioRepository extends RepositorioGenerico<Integer, Usuario> { public UsuarioRepository() { super(Usuar...
asked by 14.11.2017 / 19:35
1
answer

JPA entity generating column with double name id_municipio_id_municipio

I have an entity called districts that contains a relationship with the municipalities table. When I generate the database the table districts creates the field id_municipio_id_municipio being that was to be generated only id_municipality. cl...
asked by 28.09.2017 / 15:34
1
answer

Configure orphanRemoval = true in Generate Entities of Table - JPA Tools - Eclipse

I'm having a problem every time I need to use the Generate Entities of Table from JPA Tools (use Eclipse Neon.3). I generate the entities with the Generate Entities of Table command from JPA Tools. In the code of a class in the annotation of a r...
asked by 01.10.2017 / 05:16
1
answer

Error validating Java user, Spring

I'm having an error while validating the user against the database. I debugged and the data (from the front end) is being received by the API. The method that does the search in the database is correct, but the strange thing is that the user an...
asked by 22.09.2017 / 22:01
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

Bring all table records with jpa and eclipselink

Well, I have a question here at JPA. Today I have a method to fetch the UFs by ID, as in the example below: public Uf consulta(Integer id) { EntityManager em = getEM(); Uf uf = new Uf(); try { em.getTransaction().begin();...
asked by 15.07.2017 / 02:34
1
answer

Insert data into table with jsf, hibernate jpa

I am having problems, in the project I am developing in jsf using jpa and hibernate. I am not able to register the customer data in my database how can I relatify the registration? Code EntityManagerFactory factory = Persistence.createEntit...
asked by 22.06.2017 / 01:19
2
answers

Inserting data using JPA

I need help saving the data of an application using JPA. I followed a tutorial that only helped in the implementation of the login but did not show how to save the data. In this case, I'm trying to register a user. When I click save it shows an...
asked by 23.05.2017 / 16:51