reference « Delete « JPA Q&A





1. Delete multiple references with session.delete(object)    forum.hibernate.org

Hi, i'm new with hibernate and I would like to know if it is possible delete all entries of an object with a simple delete(object) command. I explain: *I have 2 tables, Orders and Items *I have 1 order with a list of 2 items. *then I would like to get one item from Items table and execute delete(object) Result expected: ...

2. Deleting entities with references    forum.hibernate.org

3. Save One-to-Many - Pb Delete reference but not delete record    forum.hibernate.org

Hibernate version: 2.1.5 Name and version of the database you are using: MaxDB Hello, I have a problem with I use SaveorUdapte of an entity with a one to many association to an other entity. Entity A (Car) : Volvo, Red,... Enitty B (Wheel) - Wheel 1 : Sport - Wheel 2 : Sport - Wheel 3 : Sport - Wheel ...

4. Many-to-Many reference delete    forum.hibernate.org

...

5. Problem when deleting an object [Example from Hib reference]    forum.hibernate.org

O.K. I found solution for this second error (ObjectDeletedException), an Order must be deleted from collection which contains it when deleting. But, I still getting this first error when I try to delete Order: org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1 Order is has not been deleted ! What's the problem here ...

6. How to delete object references?    forum.hibernate.org

Hi! I've been having problems removing an object that has references to it. I've searched everywhere, but none of the solutions helped me. Maybe I didn't know what exactly to search for at all... Here's the problem: - Assume we have objects Foo and Bar. - Foo contains a List of Bars. Foo's mapping file is something like this: Code: ...

8. Can i delete an object based on his reference    forum.hibernate.org

9. Many-to-Many With sql-delete: Don't delete lookup references    forum.hibernate.org

Greetings, I've been doing some digging through the forums to try to solve a problem we are currently having with our Hibernate configuration. We have two entities (lets say EntityA and EntityB) with a many-to-many relationship. Each entity has an that doesn't actually delete the record, just flips a "visible" flag in the database. Currently, we have EntityA be the ...





10. de-reference before deletion=NonUniqueObjectException    forum.hibernate.org

// Parent parent (argument) Session session = sFac.getSession(); try { session.beginTransaction(); Query qry = session.createQuery("FROM " + Child.class.getName() + " AS child WHERE child.parent=:parent"); qry.setEntity("parent", parent); for (Child child : (List) qry.list()) { child.setParent(null); ...

11. Best practice on how to delete object references    forum.hibernate.org

12. Best practice on how to delete object references    forum.hibernate.org

Fabian, First, you have to decide if, in your business model, it makes sense that a vehicle have no color., which will determine whether the foreign key is nullable or not in your DB. Then, you have to check if "color" is something that applies to other entities as well. Are there things other than vehicles that have color? If not, ...

13. How to delete an entity which has a foreign key reference to    forum.hibernate.org

How to delete an entity which has a foreign key reference to it? I think it's a simple and basic question, I have a one-way @manytomany mapping user class: @ManyToMany(fetch = FetchType.EAGER) @JoinTable( name="user_role", joinColumns = { @JoinColumn( name="user_id") }, inverseJoinColumns = @JoinColumn( name="role_id") ) public Set getRoles() { return roles; } and database definition for the middle table CREATE TABLE ...