Questions tagged as 'hibernate'

1
answer

Why use FROM with Hibernate?

I have been working with Hibernate for some time and I do not understand why they are complicated when making bbdd queries: Root<Foo> fooRoot = criteriaQuery.from(Foo.class); Join<Foo, Foo1> foo1 = fooRoot.join("foo1", JoinType.LEF...
asked by 26.05.2017 / 11:59
1
answer

HibernateException: getCriteriaBuilder is not valid without active transaction

I am developing a Java Web application with Spring MVC and Hibernate, I am new in the development with these frameworks and I am trying to list some records but I get the following: org.hibernate.HibernateException: getCriteriaBuilder is not v...
asked by 01.08.2017 / 00:05
1
answer

Entities in JPA

I am learning to use the Spring Boot framework and I need help to perform entity mapping. This is the Query CREATE TABLE testdb.user_roles ( user_role_id int(11) NOT NULL AUTO_INCREMENT, username varchar(20) NOT NULL, role varchar(2...
asked by 13.04.2017 / 10:05
0
answers

Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]:

I am developing a Java SE desktop application with Maven Netbeans, Hibernate and Spring Framework for IoC. When I run it returns this error (copied below), apparently it can not build the Bean sessionFactory declared inside my AplicationConte...
asked by 24.04.2017 / 11:24
0
answers

Leak of database connections with ThreadLocal when inspecting a Hibernate entity inside a ParallelStream

The problem is that when I inspect the attributes of an entity (Hibernate) inside a ParallelStream, sessions are created to the database in each Thread created by the Stream. These sessions can not be closed since I can not access the session. c...
asked by 02.03.2017 / 22:48
1
answer

how can I validate a junction of hours in jsf hibernate mysql

This is my managed bean public class PeliculaMB{ public EntityManager em; private Pelicula pelicula= new Pelicula(); private Categoria categoria = new Categoria(); private List<Pelicula> peliculas = new ArrayList<Pelicula>(); priv...
asked by 11.10.2016 / 22:21
1
answer

HTTP status 500 - Invalid persistence.xml. JPA + Hibernate + DAO + Servlet + JSP

This error appears when loading.    HTTP status 500 - Invalid persistence.xml.       type Exception Report       message Invalid persistence.xml.       description The server encountered an internal error that caused it not to   I could fi...
asked by 11.10.2016 / 00:15
0
answers

Raise database [closed]

I have the classes in java each with their annotations made to persist, I have persistance.xml configured in that I have no problem, my problem is how do I connect it to the mysql database so that I can create the tables?     
asked by 22.09.2016 / 01:48
1
answer

Cast Error of a Query in Spring

PROBLEM WHEN MAKING THE CASE OF A QUERY OF SQL TO A MAPEED TABLE, TO BE ABLE TO SHOW THE RESULT OF MY CONSULTATION IN A TABLE IN FRONT END. @Transactional("txsManagerSHOP") @RequestMapping(value = "getShopTable", method = RequestMeth...
asked by 08.05.2017 / 15:55
1
answer

Error creating a table with primary key composed of Hibernate

I'm trying to create a table with a composite key in Spring using Hibernate, what happens is that I get the following error:    2017-09-14 09: 07: 55.323 ERROR 9108 --- [ost-startStop-1] org.hibernate.tool.hbm2ddl.SchemaUpdate: HHH000388: Uns...
asked by 14.09.2017 / 16:30