Questions tagged as 'hibernate'

1
answer

Image upload with PrimeFaces on TomCat server, being saved only the path of the image in the database

Talk to people. I'm a beginner in Java and I'm doing a small Dynamic Web project using PrimeFaces, JSP, Hibernate and TomCat. Basically it is about several forms of registers and one of them is the register of users. The Domain, Bean, DAO, an...
asked by 10.06.2015 / 03:23
1
answer

How to map entity with hibernate to create non-unique constraints?

I'm trying to create an entity with the following mapping: @Entity @IdClass(AutenticacaoPK.class) public class Autenticacao { @Id @OneToOne(cascade = CascadeType.REFRESH) @JoinColumn(name = "codUsuario", unique = false) private Usuari...
asked by 11.06.2015 / 20:09
1
answer

Test hibernate factory

You are giving null exception on line HibernateUtil.getFactory().openSession(); in the main method. Here are the configuration and test files: <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PU...
asked by 09.04.2017 / 03:29
2
answers

Problems with JPA - Hibernate does not persist EVERY object

Good morning guys! I have the following entities: package br.com.sistema.entidade; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.JoinColumn; import javax.persistenc...
asked by 26.12.2014 / 17:57
1
answer

Fetch of children with JPA + Hibernate is not working

I have two classes, Terminal (which is the parent) and Portaria (child). I'm using JPA and it's working, but it has a bug that I can not resolve. I load a list of Terminal and when testing t.getPortarias() it...
asked by 12.01.2015 / 20:38
1
answer

JPA does not reflect the changed data in the DB manually

I have a JavaFX application with Hibernate (JPA). In this application I update a TableView with the data I search from BD (MySql). Whenever I click on the system to fetch some data in the DB, it executes the following code: public Task&l...
asked by 27.01.2016 / 16:55
2
answers

Maven Project with Hibernate and Glassfish does not generate the database

I have a Maven project and I'm having problems at the moment of generating the Database, I'm using Hibernate and Glassfish 4. No error is generated, simply the database is not generated, I'm new to Maven I may be forgetting some additional co...
asked by 10.03.2015 / 13:15
1
answer

@Enumerated (EnumType.STRING) Hibernate JPA

I have the following classificacao field in a table. This field is populated elsewhere and is filled with only 'P' or 'N' , acronyms for Positive and Negative . I then created enum Java. Classification.java p...
asked by 01.11.2017 / 18:46
1
answer

Object-relational mapping (JPA + Hibernate) using XML

For a specific reason, I need to map object-relational (JPA) of my entities with XML. [Unfortunately,] I can not use annotations to do this. It turns out that on certain properties I need to use Hibernate-specific features. For example, extra la...
asked by 09.07.2014 / 03:09
1
answer

query executes in bank but in project points error

I have a query native: SELECT dist.nome Distrito, enti.nome Entidade, dist.id_distrito, dist.codigo_dne, dist.id_entidade, dist.id_municipio, dist.id_uf, dist.flag_ativo, muni.nome Municipio, unfe.nome UF...
asked by 05.10.2017 / 13:52