Questions tagged as 'hibernate'

1
answer

Unable to build entity manager factory

<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" versio...
asked by 22.06.2017 / 17:36
0
answers

Error saving request | java web application + jsp + hibernate + vraptor

I am doing a web application (E-commerce), which is the final work of the web discipline, it is only necessary to save the request in the bank, but it is giving an error that I can not solve. I looked, but could not find anything related. <...
asked by 26.06.2017 / 20:14
1
answer

Hibernate gives insert but does not insert data into table

I have a visitor record in which I fill in the data (title and date), and hibernate executes when requesting "save" on the form. Here is the log when I ask to save in bank (MySql). 12:37:27.752 DEBUG org.hibernate.validator.internal.metadat...
asked by 15.06.2017 / 17:42
1
answer

Creating the "persistence.xml" JPA / Hibernate file

I wonder if there is a way to setup the creation (the settings) of persistence.xml at the time of project creation. Example of aqruivo: <!-- propriedades do hibernate --> <property name="hibernate.dialect" value="org.hibe...
asked by 14.06.2017 / 15:34
0
answers

Criteria Hibernate - Error

I'm getting the following Exception , I looked at my code and I can not find the error. The query is performed and returns the objects, but when it returns, it throws the exception . @SuppressWarnings("unchecked") @Override @Transactional...
asked by 23.05.2017 / 21:57
1
answer

Mount List mapped with @ManyToOne only with some objects

Is it possible to assemble a list in a class with only a few objects? @NamedQuery(name = "Curso.Aprovados", query = "select cur from Classificacao cl JOIN cl.candidato ca JOIN ca.curso cur") public class Curso { @Id @Co...
asked by 25.05.2017 / 20:57
1
answer

using EntityManager to return a List

Well, I'm having a problem when I get a list of phones from the bank, these phones have to belong to a CPF. In my query I do this public List<Telefone> buscar(Proprietario proprietario) { return this.manager.createQuery("select...
asked by 19.05.2017 / 03:56
2
answers

JPA - Java does not insert data into the database

Bean @Named("proprietarioMB") public class ProprietarioBean implements Serializable { private static final long serialVersionUID = 1L; @Inject private ProprietarioService proprietarioService; @Inject private Propri...
asked by 15.05.2017 / 20:29
1
answer

OrderBy does not work in java

I have the following structure: a contract, has several additives so I have my contract class and my additive class In the contract class, I call it: @OneToMany(mappedBy = "contrato", fetch = FetchType.EAGER, cascade = CascadeType.ALL) priv...
asked by 19.05.2017 / 18:28
0
answers

Hibernate documentation code is unclear

My question is regarding a code that is in the Hibernate documentation. I just could not understand the notation they used in the criteria.where () part. Just notice how it was put: Person_.name . Can someone explain me? Here's the snippet...
asked by 28.04.2017 / 02:47