Questions tagged as 'hibernate'

2
answers

How to find a pattern to keep the same data modeling between a JSON object, a POJO, and JPA?

To make it easier for me to understand my question, follow the example below: A POJO: public class Person { private String name; private String location; } String JSON: String json = {name:"Jose", location:"Eslovenia"}; Se...
asked by 26.07.2016 / 22:36
2
answers

Save a foreign key entity with Hibernate 4

I'm starting to study Hibernate and would like to know how to save a foreign key entity. Here is an example of two entities: Student: @Entity(name = "aluno") public class Aluno extends Pessoa{ @Column(nullable=false) private String...
asked by 23.05.2016 / 01:54
2
answers

What is the purpose of the "persistence.xml" file?

I am studying Hibernate , and on the way I came across several doubts, one of my doubts, and what is important for my learning, is about the purpose of the persistence.xml that is my unit of persistence, I read about it, however, I can...
asked by 06.04.2016 / 23:14
1
answer

How to change the default schema of postgresql in persistence.xml in a java application

I'm developing an application and I'm having a hard time changing the default application schema. I'm using PostgreSQL in a Java application with JPA and Hibernate as an implementation. persistence.xml <persistence-unit name="comu...
asked by 19.04.2014 / 23:38
1
answer

Mapping an enumeration

I have a problem with hibernate: When I try to give wakeup on the server, it gives me the following error message:    Use of @OneToMany or @ManyToMany targeting an unmapped class. Saying that I'm trying to use these annotations in an un...
asked by 16.12.2016 / 20:52
1
answer

Problems with the OpenSessionInViewer + JPA + Tomcat standard

Hello, I'm using Tomcat + JPA + Vraptor 4 and I'm using cdi to inject EntityManager as follows. EntityManagerFactoryCreator: public class EntityManagerFactoryCreator { @ApplicationScoped @Produces public EntityManagerFactory get...
asked by 28.07.2016 / 02:30
2
answers

Search for information in the database with Hibernate parameter validation

Analyze the following situation: request will provide country information that can be {0, 1, 2} . The repository method will look like this: Country Parameter Naming: 0: Bring all countries; 1: National only (Brazil) 2: Internat...
asked by 15.08.2018 / 16:30
2
answers

Close the entityManager after operations? How to manage?

I have been doing some courses and all the material I have read so far exemplifies the use of JPA / Hibernate in small examples, however, when we are developing something more concrete as a project, some questions arise. For example, before an...
asked by 29.03.2017 / 03:39
3
answers

Hibernate vs EclipseLink

Both persistence frameworks implement JPA. 1 - Is there a difference between the two? 2 - Which is the best in performance? 3 - How do the two implement the same specification, after developing a complete application is it possible to c...
asked by 21.03.2017 / 15:34
1
answer

Search in associative table

How can I search the associative table? There are two entities, Person and Time. From where I created the associative Person_Time that has id_people and id_time. My goal is to list all the id_time of a certain people_id Next error: HTTP...
asked by 12.07.2016 / 16:18