Questions tagged as 'hibernate'

2
answers

Prohibit duplicate registration

Hello everyone. I have a program that works with user registration. In this program I would like to implement a function that prohibits cpf or email registration that already exists in the database. As a database I'm using postgreSQL and Java...
asked by 24.08.2016 / 06:27
1
answer

How can I get an EntityManager from an org.hibernate.Session

Working with hibernate using Session. public class HibernateUtil { private static final SessionFactory sessionFactory = buildSessionFactory(); // A SessionFactory is set up once for an application private static SessionFactory bu...
asked by 11.08.2016 / 15:27
2
answers

Problems to generate SQL command

Hello everyone. I'm creating a project that handles user registration. In this project there will be several types of users. To simplify, let's call the types of 1,2 and 3. Depending on the type of user, the screens and features that he can acce...
asked by 03.09.2016 / 03:16
2
answers

Place default value in column

I need to leave a default value in this table column, I'm mapping the persistencies with Hibernate (summarizing the database is created according to the HQL / JPA that I define in domains. How do I set a default value for the column? @NotEm...
asked by 18.10.2016 / 18:17
1
answer

Hibernate shows ddl but does not create the tables in the database

When I started the wildfly I expected the tables to be created in the database but on the console it shows a create tables log, but nothing happens in the database. Below I show this: 14:15:00,462 INFO [org.jboss.modules] (main) JBoss Mod...
asked by 03.06.2016 / 19:21
2
answers

Problem inserting data into the database

I'm trying to insert a mass of data into the Mysql database using Hibernate. However I have the following error: 18:15:30,221 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool -- 59) HHH000388: Unsuccessful: INSERT INT...
asked by 27.04.2016 / 23:23
2
answers

Hibernate jumping id string

I generated a project by JHipster which uses Java , Spring and Hibernate in the backend, I created a class as follows: Liquibase: <changeSet id="20160504131602" author="jhipster"> <createTable ta...
asked by 06.05.2016 / 14:02
1
answer

Problem with SUM in NamedQuery

I have the following NamedQuery : @NamedQuery(name = "Controle.listarTotais", query = "SELECT controle.prestador, controle.tipoPrestador, SUM(controle.valorLote), SUM(controle.valorPago), SUM(controle.valorGlosa) FROM Controle controle W...
asked by 10.03.2016 / 18:44
1
answer

Problems (VRaptor + Hibernate request)

I'm using Vraptor to develop a web application. More on certain tests, I saw that Hibernate is adding to the database, but when I send Result to my page with a new list of that object I deleted from my client, apparently it...
asked by 15.01.2016 / 17:25
1
answer

Types problem with ProjectionList in criteria

I have a problem with java giving the following error: in class: com.app.myApp.ReportDTO, setter method of property: indicator expected type: java.lang.Double, actual value: java.lang.IntegerInteger What happens in my criteria when creating...
asked by 18.02.2016 / 16:43