Questions tagged as 'jpa'

1
answer

One-to-One Relationship in Spring JPA does not migrate the foreign key

I have two entities in my Spring Boot project that uses Spring JPA and a MySQL database with Hibernate. These two entities are related to a One to One relationship. The problem is that when I try to add a type of objects, the primary key of the...
asked by 24.11.2017 / 12:45
1
answer

Get field with jpa

I am working with jpa and to obtain this case a user through the nickname I use the following code: @Override public User obtenerPorNick(String nickName) { return entityManager.find(User.class, nickName); } That works. I understand that...
asked by 12.11.2017 / 19:40
1
answer

When creating EntityManagerFactory with the Persistence unit the program stops JAVA

I have a problem with my web application that I am developing using JPA, which worked fine until yesterday. With the help of Java DEBUG I have executed line by line and I noticed that the problem is sometimes in the EntityManagerFactory ,...
asked by 11.07.2017 / 17:00
1
answer

Problem saving with JPA

I am trying to prove a method that I have created to save in a database using JPA, it is as follows: Through the following class: public class Prueba { UsuarioImpls usuarioIm= new UsuarioImpls(); public void guardaUsuario(){ String...
asked by 06.12.2016 / 17:58
1
answer

Avoid cascade erasure JPA

I have the following class: /** To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package modelo; import java.io.Se...
asked by 06.12.2016 / 13:53
2
answers

Why does not my managerbean delete entities when sending my entity?

For some reason when trying to delete an entity with public void remove(Notification notification){ try { em.merge(notification); em.remove(notification); } catch (Exception e) { System.out.println("No se pudo r...
asked by 06.01.2017 / 20:41
3
answers

JPQL query problem

What I need to do is list the suppliers that have responded to a single request. I make the query but I get the error (Object comparisons can only be used with OneToOneMappings. Other mapping comparisons must be done through query keys or direct...
asked by 10.06.2016 / 06:27
1
answer

QuerySyntaxException: unexpected token: ON

When I run a query with the entity manager entityMan.createQuery(str.toString()).getResultList().size(); I get a syntax error org.hibernate.hql.ast.QuerySyntaxException: unexpected token: ON near line 1, column 534 [select catfiguras.FIG...
asked by 05.12.2015 / 04:03
0
answers

Problem. It does not show data from MySQL Database

I am starting a Java Web application with Java SE Development 64 bit (Version 8, compilation 1.8.0)  with JSF, JPA, Maven in Eclipse Version: Oxygen.3a Release (4.7.3a.) Spring  Database in MySQL Workbench 8.0 CE. Apache Tomcat v8.5 Server. A...
asked by 04.01.2019 / 06:52
0
answers

Thymeleaf deployable MVC

I'm with a basic project of a phone book with a series of data in which there are a series of requirements. Spring boot Thymeleaf mySql jpa The project is advanced but I find the following problem, users must have a province from...
asked by 11.12.2018 / 18:32