Questions tagged as 'jpa'

1
answer

Error with query in Hibernate

I'm trying to accomplish the following Query in hibernate: return this.entityManager .createQuery("SELECT u FROM UploadArquivoCondominio u WHERE " + " u.condominio = :ucondominio ) "...
asked by 15.02.2018 / 20:49
1
answer

Ignore parameter if null

I have the following method that searches the database: public Collection<Habilidade> pesquisar(HabilidadeForm form) throws Exception { String query = "select u from Habilidade u where u.nome like ?1 and u.geracao = ?2";...
asked by 05.01.2017 / 23:38
2
answers

Error: "Can not create JDBC driver of class '' for connect URL 'null' java.sql.SQLException: No suitable driver"

Hello, I'm trying to set up the connection to the database in my JPA application using JNDI. I'm following this tutorial ( link ), but even so when I try to make any query the system gives error saying it did not find the driver of the bank. I'm...
asked by 28.08.2016 / 23:59
2
answers

Enum getting next code in Java

I have a class in java that one of its attributes is an enum and has the following values: HIPERTROFIA(1, "Hipertrofia"), DEFINICAO(2, "Definição"), RESISTENCIA(3, "Resistência"), OUTROS(4, "Outros"); When I send the value 0...
asked by 29.03.2018 / 15:59
1
answer

JPA Error inserting a product object that has reference to an existing object

I'm having a doubt in the manytomany annotation, I know the same is meant to indicate to white that it needs to create a broker table and that in turn is located above an element that will be list public class Produto { @Id @GeneratedValue(str...
asked by 25.04.2018 / 12:38
1
answer

Can not deserialize instance of java.util.ArrayList out of START_OBJECT token

Using angular, I am not able to insert an array of genres into the Gender property that is in the Manga object. Using postman to insert the Generos array into the API / manga would look like this. { "nome": "BORUTO", "status": "...
asked by 20.11.2017 / 16:31
1
answer

Callback methods annotated in a listener bean class must return void and take one argument: javax.persistence.PreUpdate

I'm having this error on my console ... Caused by: javax.persistence.PersistenceException: Callback methods annotated in a listener bean class must return void and take one argument: javax.persistence.PreUpdate - public void digifred.model.aud...
asked by 14.12.2017 / 19:26
1
answer

Error with unexpected token JPQL

I made a select JPQL but I'm having this error: Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: where near line 1, column 151 [select pes, pEnd from digifred.model.global.Pessoas pes, digifred.model.global.Pes...
asked by 12.01.2018 / 17:16
2
answers

Is it possible to reuse the parameters of a Query in the JPA?

Hello, I have a question about Parameters of object Query on JPA . I am implementing pagination of my tables using Primefaces with LazyDataModel and in the function that I use to perform pagination I do 2...
asked by 15.09.2017 / 16:42
1
answer

How to save a csv using hibernate and mysql [closed]

I need to do the following routine: Read some information from the database; Generate a csv based on this data; Save this csv to the database; Start downloading this file to the user. I was able to do items 1 and 2, generating the f...
asked by 12.07.2017 / 16:00