Questions tagged as 'hibernate'

1
answer

How to map an entity with compound key using JPA?

@Entity @Table(name = "USUARIO") public class Usuario implements Serializable { @Id @GeneratedValue(strategy= GenerationType.AUTO) @Column(name = "ID") private Long id; @Column(name = "USER_NAME", nullable = false) pri...
asked by 03.05.2017 / 16:49
1
answer

Problem to retrieve data using Hibernate

I can list the Customer and their Animals, but I can not list the Breeds of animals. Follow the classes involved in the relationship: Client Class @Entity public class Cliente extends Pessoa { @Column(name="forma_pagamento", length=20...
asked by 09.04.2017 / 05:44
0
answers

Hibernate query (HQL) in Java with foreign key ... ERROR!

I need help with my code, I have two tables: -CDF (Employee Registry) CREATE TABLE public.cdf( ativo character varying(1) COLLATE pg_catalog."default", reg integer NOT NULL, nome character varying(30) COLLATE pg_catalog."default" N...
asked by 23.03.2017 / 22:12
0
answers

I can not delete my object in dataTable - JSF

I can not delete an object in my dataTable. NOTE: I can already persise and change. My Bean package com.irmaosuspension.controleservico.controller; import java.io.Serializable; import java.util.List; import javax.faces.view.ViewSco...
asked by 15.03.2017 / 02:33
1
answer

Jpa does not create column @lob

I am mapping a @lob field to write image to a table, but jpa creates the table, but does not create the column. I created the column manually in MYSQL, but the bytes do not persist there either. My Entity: @Entity @Table(name = "TB_IMAGEM"...
asked by 19.03.2017 / 19:42
0
answers

Hibernate Connection

I'm trying to make an application using hibernate , but when I create the .cfg.xm file it does not recognize the mysql > even though the mysql connector is in my lib folder. Someone could help me, grateful already!     
asked by 27.01.2017 / 17:48
1
answer

Error in Hibernate when executing web project

I have an error that I could not solve, I started my project and it runs right. When I access the project via the web, I log in and it enters. When I click on any button, it gives this error below: Hibernate: select person0_.id as id1...
asked by 10.01.2017 / 15:02
1
answer

Spring + Hibernate

Good morning! I am studying Spring MVC, Maven and Hibernate. In the project structure created with Maven, where do I place the applicationContext.xml file? Thank you.     
asked by 02.02.2017 / 14:42
1
answer

SQL: Record counter with data grouping of different fields

I'm having a hard time building a SQL. I have a address table with the street and crossover fields. I need to count the numbers of records that have the same crossover and group them together Example: id | rua | Cruzamento 1 | Rua Brasi...
asked by 12.12.2016 / 03:21
0
answers

Hibernate does not update information

My problem is that an unsuccessful update follows the code below. EntityManager manager=JpaUtil.getEntityManager(); EntityTransaction trx= manager.getTransaction(); trx.begin(); TypedQuery<Tipi> query = manager.cr...
asked by 03.11.2016 / 14:28