delete « Data Type « JPA Q&A





1. Hibernate DELETE_ORPHAN CascadeType not deleting orphans when collection set to null    stackoverflow.com

Hibernate is not deleting orphans when I set the collection to null, although orphans are deleted when the collection is cleared. I have the following associations.

D - entity, contains a ...

2. Delete huge number of rows from an EJB Timer    stackoverflow.com

I need to delete millions of rows from a table from within an EJB Timer. The problem is that the timer has a transaction timeout of 90 seconds, so I should divide ...

3. Hibernate sets null value for a column, instead of deleting the entire row on saveOrUpdate()    stackoverflow.com

I have a class CatastrophePerilAssoc that controls the mapping of a Catastrophe class to a Peril class, with a table CAT_PERIL_ASSOC that has three rows: id(primary key, auto-generated), catastrophe.id(mapped to a ...

4. ON DELETE SET NULL ON UPDATE SET NULL using JPA    stackoverflow.com

How do i add ON DELETE SET NULL ON UPDATE SET NULL Constraint while creating the table using JPA . Below the entity definition table

CREATE TABLE `node` (
  `id` bigint(20) ...

5. On delete set null in hibernate    stackoverflow.com

i have a Department entity which its relations is as follows:

  1. Many departments can be in one parent department:
    @ManyToOne
    @JoinColumn(name = "ik_parent_department_id")
    private Department parentDepartment;
    
  2. One parent department can have many departments:
    @OneToMany(mappedBy = "parentDepartment")
    private Set ...

6. Hibernate Delete Not Null Columns    coderanch.com

Hello Everyone. I'm trying to do a simple delete from one lowly table called 'Employees'. The table has a unique ID 'emp_no' and several columns. The columns are all 'not null' in the table and in the mapping file, Employees.java. I'm using the code below to perform the delete. session.beginTransaction(); Employees newEmp = new Employees(); newEmp.setEmpNo(10022); session.delete(newEmp); session.getTransaction().commit(); This is the ...

7. Problems with deleting an object with an array inside    forum.hibernate.org

I'm starting to loose my hair due to the following problem... I am using Hibernate 3.2.2. I have a class with an array of key-value pairs: Code: ...

8. timestamp in delete sql statement    forum.hibernate.org

I am using JDK 1.4.2_02, Hibernate 2.1.2, Oracle 9.2.0 client and server, Oracle 9.2.0 OCI8 driver. I've been trying to figure out the reason of primary key constraint violation in my code and found that this set of statements (from the log): Code: DEBUG [net.sf.hibernate.collection.BasicCollectionPersister] Deleting rows of collection: [com.orionbilling.server.model.account.Subscription.networkIdentifiers#474] DEBUG [net.sf.hibernate.impl.BatcherImpl] about to open: 0 open PreparedStatements, 0 ...

9. Why does Hibernate check not-null Properties on delete    forum.hibernate.org

When I want to delete an objekt from database hibernate throws an error when properties are null, but defined not-null in the mapping-document. Hibernate-Version: 2.1.2 Stack-Trace: net.sf.hibernate.PropertyValueException: not-null property references a null or transient value: de.advitec.bean.name at net.sf.hibernate.impl.SessionImpl.checkNullability(SessionImpl.java:1248) at net.sf.hibernate.impl.SessionImpl.doDelete(SessionImpl.java:1216) at net.sf.hibernate.impl.SessionImpl.delete(SessionImpl.java:1146) This had worked fine in version 2.0.3. Normally I just want to delete the object by ID. Thanks Andreas ...





10. Delete not working (on a transient object, I think)    forum.hibernate.org

Here is the code that is not deleting... Code: private void delete (HibernateExUser theUser) { try { Session session = HibernateUtil.currentSession(); session.setFlushMode(FlushMode.AUTO); ...

11. Delete & Insert into Set every time    forum.hibernate.org

Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message cagan327 Post subject: Delete & Insert into Set every time Posted: Fri Oct 15, 2004 12:53 pm Newbie Joined: Mon Jun 14, 2004 5:16 pm Posts: 16 Location: New York I have an Advertisement.java class that ...

12. ON DELETE SET NULL    forum.hibernate.org

Hibernate version:Hibernate 2.1.2 Name and version of the database you are using: MySql I cannot find any feature related to the very useful "ON DELETE SET NULL" feature while I'm aware of the wonderful cascade="delete-orphan" feature, that can be mapped to the database as an "ON DELETE CASCADE" sentence. Suppose I have a class/table named PARENT, while class/table CHILD contains objects ...

13. deleting entries by date type    forum.hibernate.org

14. How to implement ON DELETE SET NULL semantics?    forum.hibernate.org

It would be nice if someone has an answer to the above question! Thanx. Just a short description: Two classes A and B have a one-to-many relationship (A 1 : n B), but the useful access path in my case is from B to A. So the best way to do this in Hibernate is to implement a many-to-one relationship from ...

15. delete transient    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp [b]Hibernate version:[/b] [b]Mapping documents:[/b] [b]Code between sessionFactory.openSession() and session.close():[/b] [b]Full stack trace of any exception that occurs:[/b] [b]Name and version of the database you are using:[/b] [b]The generated SQL (show_sql=true):[/b] [b]Debug level Hibernate log excerpt:[/b] When I tried to delete a detached object just after get from the database, hibernate complained ...

16. Set FK to null instead of deleting row when removing assoc?    forum.hibernate.org

I have sketched out the relationship details below. A volunteer has a collection of Opportunities. Being associated with this table means that they have volunteered for a position at an event. When I remove the Opportunity from the Volunteers collection, Hibernate tries to delete the entire Opportunity row. Instead, I want Hibernate to set the "volunteer_id" column to NULL. How can ...





17. How to force a "ON DELETE SET NULL" ?    forum.hibernate.org

Hi! This is how my simplified association looks like: I have got an employee and a pc table. Code: ...

18. help...many-to-one delete when column goes null    forum.hibernate.org

I have have all kinds of entities in my application which have addresses so i have a separate address table that they all have foreign keys to. The address mapping is as follows: Code: ...

19. "on delete set null"?    forum.hibernate.org

Hi all, I have read through the reference and HIA book, but, I still don't see how I can specify this common database foreign key constraint "on delete set null". Is this doable in Hibernate? My issue is I rely on hbm.xml files to generate my schema, so is there any way to "inject" this in? Thanks in advance! Liem

20. Problem with delete on first time called....    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Basically... the problem in here is not sql related, at least not directly. The mappings, the selects, the update, all work. The problem is with the delete, i have an action event triggering a delete event(in a jtable in this case), when the action is triggered the first time, hibernate does ...

21. why there's not-null property check when deleting objects ?    forum.hibernate.org

I delete an object with a property(not the id) which the attribute not-null is true. I just create a transient object and set the id to the identifier. then I called delete(obj). it failed and throwed a PropertyValueException. finally I need to set the not-null property to a not null value to settle this problem. but what is needed to delete ...

22. null values in records which needs to be deleted    forum.hibernate.org

table="PHONE_NUMBER">

23. PropertyValueException: not-null property on delete    forum.hibernate.org

...

24. Deleting transient object with empty not null property    forum.hibernate.org

Why would you want to delete a transient object? This makes no sense to me. The Hibernate Documentation defines transient as follows: Transient - an object is transient if it has just been instantiated using the new operator, and it is not associated with a Hibernate Session. It has no persistent representation in the database and no identifier value has been ...

26. How to delete large number of objects    forum.hibernate.org

I have an operation that will generated a collection of objects needs to be deleted from the database, about 1 million of them. The way I used now, is to delete the entry one by one in one transaction. iter = list.iterator(); tran.begin(); while(iter.hasNext()) sesssion.delete(iter.next()); tran.commit(); However, this has been really really slow. And one thing I don't understand is why ...

27. Hibernate sets key column to null rather than deleting    forum.hibernate.org

Author Message mangelo Post subject: Hibernate sets key column to null rather than deleting Posted: Fri Mar 14, 2008 5:55 pm Beginner Joined: Thu Aug 17, 2006 12:44 pm Posts: 22 Location: Ohio I have a one to many collection. It has to be one to many because there are some fields on the child record. When I remove ...

28. Delete an array    forum.hibernate.org

... for (SkillableJob skillableJob : skillableJobs) { Job job = skillableJob.getJob(); job.removeSkillableJob(skillableJob); //getSession().delete(skillableJob); } Query q = getSession().createQuery("delete SkillableJobSeeker j " ...

29. On delete set null...    forum.hibernate.org

Hi, I have a question which I can't find the answer to. I have two tables. A and B A is the parent and can have a B. B is not aware of which A has it. I have set up so that everything works the way I want except for one thing. I want to be able to delete a ...