Questions tagged as 'jpa'

2
answers

How to name a constraint in Hibernate / JPA?

Using the class: @Entity public class Pessoa{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long idPessoa; @Column(nullable=false, unique = true) private String nome; @OneToOne @JoinColumn(name...
asked by 30.03.2016 / 14:44
2
answers

Configure IP for server access using Hibernate

I have a Java application that uses Hibernate, for development I did the configuration of the database using the localhost however for use on other computers I will need to define the IP that will own the database (Server) in my project I use th...
asked by 02.06.2015 / 16:15
1
answer

Query specified join fetching, but the owner of the fetched association was not present in the select list

I have a scenario with the following entities: Treinamento , Curso and Aulas . A Treinamento has a ManyToOne relationship for Curso . And Aula has a ManyToOne relationship to Curso . I want...
asked by 27.04.2016 / 17:54
2
answers

Datatable not population object? JSF

I have the following problem: I have a DataTable that is populated with entities of type Login that belongs to Usuario as relationship. A button named Add Login calls the method addLogin() of Login...
asked by 13.10.2015 / 22:46
1
answer

How to make hibernate read a table in a MySQL database and write to another table in PostgreSQL?

I need to query a database in MySQL and get a table from there to write to a PostgreSQL database through Hibernate / JPA. I configured persistence.xml as follows: <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="ht...
asked by 12.02.2016 / 22:14
2
answers

How do I persist the String of an Enumerator in the Database?

I have the following Enumerator: public enum ETipoCasa{ Propria, Alugada, Financiada, Cedida; } And I'm trying to persist in the bank the String of this enumerator as the example: Casa casa = new Casa(); casa.setTipo...
asked by 02.07.2015 / 17:23
1
answer

JPA annotation @OneToMany or ManytoOne?

I have the Report Class public class Report{ private String nome; @ManyToOne @JoinColumn( name = "idpai", referencedColumnName = "id" ) private List<Report> subReports getters e setters... } My question is how t...
asked by 16.01.2018 / 13:08
2
answers

I can not save to the database in a Spring MVC project

I'm going to explain the project because I believe that most people usually create the projects using XML, and I created the Spring MVC project by dismissing the files that configure the project as XML. The problem with my project is that I c...
asked by 21.10.2015 / 03:19
1
answer

Why does the EntityManager not have the createQuery method with a typed return?

I'm following the Spring-MVC book project of House Do Code, using the latest version of Hibernate, 4.0.3. But at a time, when the book indicated the creation of a quoted query through the following code: // manager é um objeto da classe jav...
asked by 09.11.2015 / 21:58
1
answer

How to fix the "No Persistence provider for EntityManager named" error?

When I try to execute the Persistence.createEntityManagerFactory("Aluno") method of class Persistence I get the following error: run: abr 04, 2016 9:11:30 PM org.hibernate.ejb.HibernatePersistence logDeprecation WARN: HHH015016: E...
asked by 05.04.2016 / 02:29