Questions tagged as 'hibernate'

1
answer

java.lang.NoSuchMethodError: org.hibernate.cfg.Environment.verifyProperties (Ljava / util / Map;) V

I work on a Java project and when I change the machine, I need to inform the libraries of the project again, but when compiling it generates an error in the output. Output: Exception in thread "main" java.lang.NoSuchMethodError: org.hiberna...
asked by 28.10.2015 / 01:03
1
answer

Login with JAAS + Tomcat

I have done the JAAS configuration procedures in my JSF project, when I try to access it, it shows the information that user and password does not give, but I already created the user table. context.xml<Contextpath="/FastChoice"> <...
asked by 06.11.2015 / 17:33
1
answer

Why are tables created in hibernate deleted after stopping the server?

I run my site and it generates the tables in the database. I even can register in the database through the site and his select it shows that it has been registered. But if I stop the server, and see the tables in MySQL, the table is gone....
asked by 02.10.2015 / 20:42
1
answer

How do I populate an arraylistType with a result fetched from the mysql database using Hibernate?

On many topics I see a piece of code I can not reproduce: Query query = session.createQuery() I can not create this session object with the createQuery () method as an option. Can someone show me an example of how to populate an ArrayList...
asked by 05.09.2015 / 16:16
1
answer

The find () method of my DAO Generic entityManager is giving NullPointer, how to fix it?

The change from my DAO looks like this: private EntityManager entityManager; public void alterar() throws Exception { System.out.println("T encontrada"); System.out.println("iniciando Alterar id: " + this.getId()); System.out.prin...
asked by 20.08.2015 / 22:20
2
answers

java.lang.String can not be cast to com.sisEnade.tcc.modelo.Questao

Good afternoon. I'm having the following error: java.lang.String can not be cast to com.sisEnade.tcc.modelo.Questao However, I could not resolve the error. The purpose of the implementation is to create a filter, to bring to the user que...
asked by 12.10.2015 / 19:08
1
answer

How to link a Query to a Container?

TypedQuery<Empteste> minhaLista = em.createQuery("Select d from Empteste", Empteste.class); List<Empteste> results = minhaLista.getResultList(); I want this my list result to appear in my JPA CONTAINER I was trying this, but I...
asked by 03.12.2015 / 13:53
1
answer

@Size, using hibernate validator, acknowledges error in value that should pass validation

I have a Java SE application where I can not use the @size annotation. This annotation is handled by org.hibernate.validator.Size. It has a user field in the template in which I do this: @Size(min = 1, max = 30) @Column(name = "CAMPO")...
asked by 06.08.2015 / 20:16
1
answer

Verify that the data entered by the user already exists in the database before inserting

I need to check in the database if the information that the user is trying to insert already exists, for example: In the registration of a company, I can not allow the same CNPJ for others. I'm doing in JSF 2 with JPA2 Hibernate. I did an exa...
asked by 20.04.2015 / 15:53
1
answer

Error changing application from H2 to PostgreSQL

I was developing a benchmarking application H2 just for testing and everything was working. When I finished the implementation I changed the connection from JPA to PostgreSQL , but when I did this the system stopped persis...
asked by 31.05.2015 / 16:06