Questions tagged as 'hibernate'

1
answer

Paging with large amount of data

Thinking about performance, what is the best way to page a large amount of data? I'm currently using a List<Produtos> , saving around 500 products in it, and using subList(min,max) , returns what I need. However, I think t...
asked by 27.04.2016 / 16:28
1
answer

CascadeType.ALL does not work. Am I using it wrong?

In my code, I have the Author and Book classes with the Many To One relationship, as below: Author.java import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.F...
asked by 20.12.2016 / 14:03
1
answer

What is the difference between annotation in method and annotation in attribute

Now, I've started to learn and use hibernate recently, and when looking for answers to my questions regarding annotations I've come across the following occasions: 1st) The attribute has the annotation @Column private String descrica...
asked by 23.07.2015 / 15:58
2
answers

Doubt how to configure Spring Data with Hibernate

How to configure Spring Data + hibernate Hello everyone, I'm new here in stackoverflow and also in developing java Web. I'm learning some Spring Frame stuff and am wondering how I can set up Spring Data in my Dynamic Project. Below is...
asked by 24.08.2014 / 16:42
1
answer

Multi Tenancy with Hibernate update schema

Hello, I'm using an application that uses multiple (multi-tenancy) databases using hibernate. I would like to know if anyone knows any way Hibernate can do the update in the schema of the banks. I have already set the hibernate.hbm2dll.auto: upd...
asked by 05.07.2016 / 22:38
2
answers

Problems with lazy Hibernate

Friends, all good? I have a problem that is famous: org.hibernate.LazyInitializationException: . I know this is because the session has been closed and hibernate can not connect to make the selects and so on, but then how do I get the dat...
asked by 20.05.2015 / 15:47
1
answer

Popular via constructor with hibernate

I was reading this article link and talks about using builders for popular the objects and set aside some setters. How can I use constructors to populate an object with hibernate? At the time of picking up the form data and saving for example....
asked by 09.01.2016 / 00:15
1
answer

java.lang.IllegalArgumentException error in Hibernate when working with enum

Take a look at the error message: jun 02, 2015 5:23:57 PM com.sun.faces.lifecycle.ApplyRequestValuesPhase execute ADVERTÊNCIA: /WEB-INF/template/pedidos/CapaPedido.xhtml @29,99 completeMethod="#{cadastroPedidoBean.completarCliente}": java.lang...
asked by 02.06.2015 / 22:28
1
answer

Access database in OpenShift

I deployed a project in OpenShift , I used a cartridge to create a Mysql database soon after the creation of the database this information appears:    MySQL 5.5 database added. Please make note of these credentials:       Root...
asked by 05.10.2015 / 22:35
1
answer

How to implement a "one to zero" mapping?

The scenario is as follows: A user can have many or no comments on bulletins published on a system - obviously, a comment belongs to a single user. The problem is that Hibernate has no annotations of type @OneToZero or something simila...
asked by 12.05.2015 / 19:24