Skip to content
Advertisement

Tag: persistence

Hibernate 5 and JPA: select table without his children but maintain persistence on save

I have two models: Ordine and DettaglioOrdine. I would like that, when I save an object of type “Ordine”, hibernate also save his child “DettaglioOrdine” (and this works). But, if I do a select query, the query is very very slow because hibernate retrieve also DettaglioOrdine. So, I would like the “Ordine” object without “DettaglioOrdine” object. “Ordine” model: DettaglioOrdine Model:

Problem with Foreign Key in @OneToOne annotation

I have spent a couple of days with a weird problem. There is a plethora of similar posts here in StackOverflow and I have check a lot of them but I was unable to find something similar with this. I have a Human Parent class A User child class : and also a CollectionOfContactMethods with composition relationship with the User.

Repository Pattern with Repository Factory

I’m trying to improve my Android persistence layer to be used across multiple applications. What i have done so far is to setup a base repository abstract class and also a base repository interface, the complete code can be check here: https://github.com/grmaciel/android-repository-ormlite Interface: Now all my repositories extends my base repository, like this: What i’m trying to achieve now is

Advertisement