Questions tagged as 'hibernate'

1
answer

Relationship between composite key classes → error: not mapped to a single property

I have a VARIANCE class that has a compound key (FK_T, FK_F, FK_F_VARIACAO). Two of these primary key fields (FK_F, FK_F_VARIACAO) are also foreign key to the FARIA table, in a ManyToOne relationship @ManyToOne(fetch = FetchType.LAZY) @JoinCol...
asked by 08.04.2015 / 21:41
0
answers

Criteria: Subquery with multiple columns

I have the problem and I can not resolve it. How to turn this query into NHibernate Criteria. SELECT ordid, prodid, qty FROM item WHERE (prodid, qty) IN (SELECT prodid, qty FROM item WHER...
asked by 28.05.2015 / 22:08
2
answers

Cache Problem - Saving Bank Data to Java System

I have a system developed in Java using JPA, Hibernate, Primefaces. When I write system registry it reflects in the MySQL database normally, so far OK, but when I do unlike the database (register or change) in the application with several F5 it...
asked by 08.05.2015 / 20:36
0
answers

JPA (hibernate) automatically update entities [closed]

I have the following question: I realized that when I use JPA (Hibernate) + Spring in a JSF application (PrimeFaces) my entities are not updated immediately when registering, for example, I have a User when doing the same everything happens norm...
asked by 10.02.2015 / 20:41
1
answer

How do Hibernate Search sort the result of a search?

I have a indexed search with Hibernate Search but I can not get Hibernate Search sort the search result by the order of a particular column , such as the column name. But there is a quirk . When the search is done using some term, the r...
asked by 21.03.2014 / 19:03
1
answer

BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

I'm having this error when running my application: 05-Oct-2016 21:18:25.586 SEVERE [localhost-startStop-26] org.apache.catalina.core.StandardContext.listenerStop Exception sending context destroyed event to listener instance of class org.spri...
asked by 06.10.2016 / 02:48
1
answer

Get list of persistent JPA / Hibernate objects

Hello, how do I get the list of persisted objects before committing it to DB. Here's the example below: Pessoa p = new Pessoa("Joao", 21); Pessoa p2 = new Pessoa("Pedro", 17); Pessoa p3 = new Pessoa("Maria", 32); //Entendo que nesse momento o...
asked by 03.03.2015 / 13:02
2
answers

Hibernate ORDER BY ASC | DESC does not work by passing by parameter

Well, I have a problem with sorting a query, where I am passing the field name along with ASC or DESC as the query parameter, but hibernate is not finding himself, returning the query without the ordering. Would anyone have a solution to thi...
asked by 31.03.2016 / 22:43
1
answer

orphanRemoval JPA

How does orphanRemoval work? Why when I put it in a list does not work ex: @OneToMany(mappedBy = "simulationMedia", cascade = CascadeType.ALL, orphanRemoval = true) @JsonIgnore private List<SimulationChemicalMedia> simulat...
asked by 05.10.2015 / 22:19
4
answers

Hibernate - How to fetch all rows from a table with Hibernate?

I'm not able to fetch all rows from a table with Hibernate. Does anyone know the name of the method that does this?     
asked by 05.07.2018 / 18:53