Questions tagged as 'jpa'

1
answer

Problem with javax / persistence / Persistence using JPA with CXF

I'm facing an error when I try to consume a web service that is using JPA (Eclipse-link) to insert data into the database.    Classes Entity: @Entity @Table(name = "gato") public class GatoPersistente implements Serializable { private sta...
asked by 04.02.2016 / 12:19
1
answer

How to mount a generic query using jpa nativequery

Consider the following table: table: people_info || row || name || surname || nationality || time_do_coracao | 1 | marcelo | aragao | brasil | sp | 2 | maria | fonseca | brasil | sp | 3 | joao | timotio | brasil | palmeiras | 4 | marce...
asked by 16.01.2016 / 11:46
1
answer

Problem inserting object with ManyToOne JPA

I'll try to exemplify my problem with simpler classes than in my application: I have, for example, the Main class and an Item class. In Main, I have an Item property annotated with ManyToOne, which I mapped to the database only by the id_item...
asked by 19.01.2016 / 12:27
1
answer

Error: 'Operand type clash: image is incompatible with numeric'

When trying to save an object in the database, it gives the following exception:    org.hibernate.exception.DataException: could not update. [...] Caused by: java.sql.SQLException: Operand type clash: image is incompatible with numeric. I...
asked by 18.11.2015 / 12:19
0
answers

Error returning object after query

Good night everyone. Objective: The main goal is to get the user ID and the code of the simulation he answered, and display this on another screen after he responds to this simulation, however, I have exception when trying to perform a query...
asked by 07.11.2015 / 02:38
0
answers

Selecting sets of JPA values

I have the following problem: I have a table with a list of values for a composite key. Here's an example: ID | ItemCode | Localidade | Preco ---+----------+------------+------- 01 | 001 | 001 | 3.5 02 | 002 | 001...
asked by 26.10.2015 / 19:09
0
answers

Could not determine type for: java.util.List, at table: ..., for columns: [org.hibernate.mapping.Column (...)]

I'm having a very simple problem using JSF + JPA with Hibernate. I have two classes: Message and Comment. The Message class contains a list of Comments. But when trying to make that relationship the error below happens. Can anyone help? Thanks!...
asked by 26.10.2015 / 16:26
0
answers

Persist blob field with file extension - JPA, Hibernate

I need to persist an attachment like a pdf, xls, etc. (type blob field). I need to recover this file after persisting it and I do not want the user to enter the file extension. I was guided in another question to create a table only...
asked by 02.10.2015 / 19:17
0
answers

Error while trying to update: failed to initialize initialization collection, could not initialize proxy component p: selectManyMenu

I'm mapping a list with @ManyToMany (fetch = FetchType.EAGER) , and I'm getting the following excpetion when I try to UPDATE a record in BD: ADVERTÊNCIA: failed to lazily initialize a collection, could not initialize proxy - no Session o...
asked by 29.09.2015 / 21:31
0
answers

Outdated data in Hibernate + JPA queries

I noticed a problem in my Spring application, I'm implementing an internal messaging service and when I create the display of the amount of unread messages I realized that the value varied with each update, whenever a new message arrived. In sho...
asked by 23.09.2015 / 19:44