Questions tagged as 'hibernate'

1
answer

How can I map a VISTA or a STORED PROCEDURE from an sql server database with Hibernate in java se?

How can I map a VISTA or STORED PROCEDURE from a sql server database with Hibernate in Java SE?     
asked by 18.08.2018 / 23:57
2
answers

Differences between java.util.Date and java.sql.Date

I would like to know what is the difference between the objects java.util.Date and java.sql.Date , also if I am creating an application using Hibernate JPA which of these objects should I use to save my dates. I must say that m...
asked by 28.08.2017 / 22:43
1
answer

Hibernate NullPointerException when executing session.close ();

Very good, I am using hibernate for the first time and I am trying to make a simple application where I now skip an error that I do not know what it might mean. I followed a series of tutorials in which I explained how to configure everything an...
asked by 03.09.2017 / 17:28
1
answer

Error using JPA

Well, my situation is as follows. I am working on a final project that I have to deliver tomorrow with a friend. We are working at par. I do not know what happened, from one moment to the next I get the error: Exception in thread "main" javax....
asked by 11.12.2016 / 14:32
2
answers

Delete user by ID

I have the following link <div class="col-md-8"> <a href="borrarUsuario/${session.userData.id}">Borrar Usuario</a> </div> This is the controller method that clears @RequestMapping(value="/borrarUsuario/{id}",me...
asked by 21.11.2018 / 09:00
1
answer

How to add restrictions to object of type "Criteria" when the criterion attribute is of an external class?

I have the following dilemma to generate a list of all the credentials that belong to a specific physical host. Class FisicHost @Entity @Transactional public class FisicHost { @Id @GeneratedValue(strategy = GenerationType.IDENTIT...
asked by 06.11.2018 / 21:50
1
answer

Hibernate, exception when doing update

I have an exception when calling an update () method of the UserService class, with the aim of updating a user's data stored in the db. UserService class: import java.util.List; import db.hibernate.dao.UserDao; import models.User; publi...
asked by 07.11.2018 / 23:32
1
answer

How to create classes for object / relational mapping?

I am new to hibernate and jpa, I have to create 3 classes User, Client and Attribute that will be mapped to tables, the classes have the following properties: User has: id, name, surname, password, many clients, many Attributes. Clien...
asked by 07.11.2018 / 14:29
1
answer

java.lang.ClassCastException: java.lang.String can not be cast to entities.User

I'm using the ViewPreparer class to prepare my modules, but I'm getting this error: java.lang.ClassCastException: java.lang.String cannot be cast to entities.Usuario The complete trace of the error is as follows: java.lang.ClassCastExcept...
asked by 06.10.2018 / 19:33
1
answer

Hibernate + Abstract Classes

Following as regards my doubts about Hibernate is concerned. Let's say I have a database with the table asignatura . CREATE TABLE IF NOT EXISTS 'asignatura' ( 'id' int(11) NOT NULL, 'name' varchar(12) NOT NULL, PRIMARY KEY ('id') )...
asked by 17.08.2018 / 16:10