Questions tagged as 'hibernate'

1
answer

HQL query with list of ENUM as parameter

Hello, I have the following problem, here is an example: I have an entity Banda that has as attribute a list of genres List<Generos> generos , Generos is an ENUM with the following values: ALTERNATIVE_ROCK("Altern...
asked by 31.12.2014 / 03:43
1
answer

Mapping composite IDS

I have a problem mapping a class in Hibernate 2. I have a table "CONF_PGTO_CLIENTE" which has columns (LOOP_ID, CLIENT_ID, TYPE_PGTO), all 3 columns are primary keys and I need to map this in ".hbm.xml". My class is: /** * Configuração...
asked by 22.12.2014 / 12:31
6
answers

Hibernate is not creating the tables

I'm new to Hibernate, because of the little I've learned, I believe I did everything right, that is, I downloaded the dependencies, I wrote down the classes, etc. Below is my example class: package br.com.evolutionary.modelo; import javax.per...
asked by 12.05.2016 / 01:18
3
answers

Where should I put a calculation method? In the entity itself or in the business class?

I have an architectural doubt, I believe. I need to create a method that receives a date range and an entity on which to perform a search in the period quoted. In fact, to ask this question it matters little what the parameters of this method...
asked by 27.04.2016 / 21:52
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
2
answers

Enum as Parameter NamedQuery Hibernate

Is there any way to pass as a parameter in a NamedQuery the value of Enum . public enum TipoConta{ CREDITO("Cartao de Credito"), DEBITO("Cartao de Debito"); private final String descricao; TipoConta(String descricao) {...
asked by 15.01.2015 / 16:33
1
answer

Infinite recursion (StackOverflowError): Error listing products with categories and unit of measures

Good afternoon! I'm trying to list the products registered, but the error below happens: Failed to write HTTP message: org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Infinite recursion (StackOverflowE...
asked by 01.10.2017 / 19:32
2
answers

Why does Spring boot not use EntityManager?

Some time ago I was studying Java EE with handouts. It used JSF and Hibernate . I am now working with Spring and Hibernate . But different from Java EE , I do not create any EntityManager . Is it not required?     
asked by 23.12.2018 / 05:35
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