Skip to content
Advertisement

Tag: hibernate

How can I cascade delete a collection which is part of a JPA entity?

In one of my jobs I have the following code: This always fails to delete the entity with the following error: The DELETE statement conflicted with the REFERENCE constraint “FK966F0D9A66DB1E54”. The conflict occurred in database “TFADB”, table “dbo.MonthlyReport_categories”, column ‘MonthlyReport_id’. How can I specify the mapping so the elements from the categories collection get deleted when the report is deleted?

hibernate or oracle support for timelines?

We have a requirement for persisting, using Hibernate, versioned Java objects into an Oracle database such that each version has a valid-from and valid-until timestamp. This is so we can query for objects as-at a specific time. Does Hibernate or Oracle 11g (or anything else) provide anything that would simplify this? Answer Have a look at Hibernate Envers The Envers

How to use object oriented programming with Hibernate?

While using ORM tools such as Hibernate, I’ve found it is advantageous to keep all business logic out of my business objects and instead keep it in a service layer. The service layer creates the business object POJOs, manipulates them, and uses DAOs to save them. But isn’t this in a way taking a step backwards from the object oriented

What’s the advantage of load() vs get() in Hibernate?

Can anyone tell me what’s the advantage of load() vs get() in Hibernate? Answer Whats the advantage of load() vs get() in Hibernate? load() get() Only use load() method if you are sure that the object exists. If you are not sure that the object exist, then use one of get() methods. load() method will throw an exception if the

Advertisement