Questions tagged as 'hibernate'

2
answers

After @JoinColumn JPA does not find entity attribute

I have two entities that are directly related to State and City and my intention was to rename the foreign key present in the client entity, changing for example, 'city.status_id State' for 'city.status'. For this I used the annotation @Joi...
asked by 28.03.2017 / 04:50
1
answer

Is it necessary to create a hibernate.cfg.xml to use HibernateStatistics?

I found it nonsense, since hibernate settings are usually allocated in xml persistence. Can you retrieve the sessionfactory only by using the hibernate settings allocated in persistence.xml? or do I need to replicate ORM settings to hibernate...
asked by 28.02.2017 / 22:18
1
answer

JPA-HIBERNATE: I understand the conjunctures and disjunctions? That's right?

I took some JPA handouts and read some tutorials on the internet, but I'm still a bit lost with regard to disjunction and conjunction in JPA. From what I understand the conjunction serves to group conditions with the "AND" of the sql, since t...
asked by 19.02.2017 / 23:02
1
answer

Error querying data in JTable with Hibernate

The following error occurred while querying the data: INFO: HHH000182: No default (no-argument) constructor for class: Classes.Funcionario (class must be instantiated by Interceptor) Hibernate: select funcionari0_.ID_Funcionario as ID_Fun...
asked by 09.01.2017 / 22:57
1
answer

Target Unreachable, identifier 'users' resolved to null

My bean: package com.cliente.Bean; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import org.omnifaces.util.Messages; import com.sist...
asked by 05.01.2017 / 19:42
1
answer

Hibernate inserts optimization when there is relationship @ManyToMany

Imagine relationships:    User has many Permissions       Permission has many Users We can create a N para N relationship as follows: User.class public class User { /*Many attributes here*/ private List permissions;...
asked by 18.01.2017 / 04:28
1
answer

Create selects with hibernate criteria generic

I'm doing a web-based, administrative software, it has several graphs and several tables, the problem with this is that several graphs and tables generate many queries to the database, and with this, many classes that have a similar structure, F...
asked by 13.12.2016 / 14:14
1
answer

Injection dependency failure [duplicate]

I'm new to the Hibernate world and when I run this application, I get the following exception (error is relative to EntityManager persist): java.lang.NullPointerException Caused by: java.lang.NullPointerException at com.nataniel.a...
asked by 27.11.2016 / 03:27
1
answer

Searching for data in another bank schema using createQuery

In postgres, we can fetch data in multiple schemas through the same sql. Doing so: SELECT * FROM meu_schema.minha_tabela Is it possible to do this using createQuery ? By default, my application is using public schema, but I wanted to...
asked by 18.11.2016 / 19:29
1
answer

Hibernate returns many queries and overwrites my changes

Good afternoon, I'm trying to make a change in a datatable, when I click on rowEditor, the value is sent correctly, but I do not know why, many queries are being performed with hibernate. I do not know if I could explain myself correctly, but I...
asked by 12.10.2016 / 20:10