Questions tagged as 'hibernate'

1
answer

Return values for all months of the year by drawing per month

I have the following SELECT: SELECT coalesce(sum(vs.total), 0) FROM tabela_exemplo t WHERE extract(year from t.data_entrada) = extract(year from current_date) GROUP BY extract(month from t.data_entrada); What returns the following result:...
asked by 20.10.2015 / 21:13
1
answer

Hibernate - duplicate key value violates unique constraint

I have the following problem: Person: @Entity @Table(name="tb_pessoa", schema="public") @Inheritance(strategy = InheritanceType.JOINED) public class Pessoa implements Serializable { private static final long serialVersionUID = 1L; @I...
asked by 16.06.2015 / 23:42
1
answer

Lazy Load OneToMany

Hello. I'm having difficulty running my fetch = FetchType.LAZY relationships with the @OneToMany annotation. In my entity Nota Fiscal, there are several lists fetch = FetchType.LAZY, when loading the object by id, I load all these lists with...
asked by 22.09.2014 / 19:46
1
answer

Query using Hibernate does not record

I'm trying to query the HSQLDB database using Hibernate but I'm not succeeding. When I do: session.get(Usuario.class, new Integer(1)); Query is done because it shows the query mounted by Hibernate. But it does not have any registry, even...
asked by 19.05.2018 / 17:09
1
answer

Annotation @ManyToMany in the same entity / table

My Class: @Entity public class Report extends AbstractModel implements IReport { @Column private String nome; @Column private byte[] arquivoJrxml; @ManyToMany private List<Report> subReports; My question: My Report class has s...
asked by 25.01.2018 / 11:50
1
answer

Error when deploying on Wildfly

I'm getting an error while trying to deploy my application on Wildfly 8:    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011445: Failed to get adapter for persistence provider 'org.hibernate.jpa.HibernatePe...
asked by 10.02.2014 / 19:15
1
answer

How to Call Other Class Values

I am creating a vehicle control, and in it I have a Fuel register that has description and value, and another cadastre of Supplies. In my supply register has a autoComplete of Fuel. The problem starts here, when I select the fuel I need t...
asked by 16.11.2016 / 13:39
1
answer

can not be cast to java.util.Map

The method below that I created in the model layer, is returning the error "can not be cast to java.util.Map" public List<NotaFiscalProduto> listaItens (boolean entSaid, Date dtinicio, Date dtfim){ Criteria r = this.session.createC...
asked by 14.11.2016 / 12:19
1
answer

Performace in native query

Good morning, I'm on a project where I have to build charts based on queries made in a Postgres database. This bank has a BI framework and the tables have an average 40 million lines . The queries I'm supposed to make at the bank are be...
asked by 01.08.2016 / 15:16
1
answer

"Error" CRUD Hibernate JAVA

Folks, I'm starting to learn how to use hibernate, and a kind of "error" occurred while a registry persisted. When registering an object player I must also pass the team of that player, however, the team is already registered in the database, so...
asked by 09.09.2016 / 20:37