Questions tagged as 'hibernate'

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
1
answer

How to do a login authentication?

I'm having a problem signing in to. I have a simple page: Ijustneedtoquerythedatabaseifthevalueenteredbytheuseristhesame.Thisonehere:Model:@EntitypublicclassUser{@Id@GeneratedValue(strategy=GenerationType.IDENTITY)privateIntegerid;@Column...
asked by 12.06.2017 / 23:21
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
1
answer

References lost at the time of persistence

Below are my entities and relationships: Order: @Entity @Table(name = "encomenda") @XmlRootElement(name = "objeto") @XmlAccessorType(XmlAccessType.FIELD) public class Encomenda { @Getter @Setter @Id @GeneratedValue(strategy...
asked by 22.03.2017 / 13:11
2
answers

How to load the persistence.xml settings in ComboPooledDataSource?

I configured C3P0 via persistence.xml, however, when I try to retrieve the configuration values via ComboPooledDataSource, the received values differ from what was configured in the configuration file. <properties> <!...
asked by 28.02.2017 / 21:34
2
answers

How to translate the MySql query that has a sum for Hibernate?

I need to translate the following MySql query to Hibernate: select sum(TOTAL_MERCADORIA_BRL) from PROCESSO group by PERIODO like 'DEZ-15'; What would be the best way to do this query, but using Hibernate?     
asked by 16.12.2015 / 16:41
2
answers

How to perform a SUM in Hibernate

I'm trying to do a select via HQL but Java can not identify SUM by generating the following error: java.lang.NullPointerException at org.hibernate.dialect.function.StandardAnsiSqlAggregationFunctions$SumFunction.determineJdbcTypeCode(StandardA...
asked by 19.02.2016 / 23:02
1
answer

SQL / JPQL Query

Friends, good afternoon. I have a table in the database called Questao Inside the table I have two columns that are ID and Question . I have a filter that I can not specifically bring only code and asks because the method return is an ob...
asked by 13.10.2015 / 21:06
1
answer

Problem with Like for Criteria

Good morning. I have a table in the following format: Ineedtomakeaselecttoreturnthesumofthevaluesoftheinfrastructuregroupedbyyear.IcreatedthisqueryinSQL:selectYEAR(dataCompraInfra),sum(valorCompraInfra),sum(valorVendaInfra)fromconcessaoin...
asked by 05.09.2015 / 15:55
1
answer

How to write image to database with JSF2

I'm having a JSF project with the DAO template using Hibernate , and I'm having a hard time understanding how to save the image in the database. I just need to know what the method would look like to save an image to a DAO cla...
asked by 07.05.2015 / 23:58