hql « Delete « JPA Q&A





1. hibernate delete using hql    stackoverflow.com

I have the following mapping in hibernate:

    <class name="com.foo.bulk_delete.test3.lim.bl.pom.impl.P4" table="P4_BDELETE">
    <list lazy="false" fetch="select" batch-size="25" name="strings" table="L_st_49eea" >
        <key>
 ...

2. Problem with Hibernate HQL Delete    coderanch.com

3. HQL add works, delete doesnt    coderanch.com

4. hql delete all    coderanch.com

5. Hql delete syntax?    coderanch.com

I have a table named 'insurance'.Column names are ID,insurance_name,invested_amount,investment_date. Mapping object class to 'insurance' is Insurance.java.It has the required methods(setter,getter) to bind with the 'insurance' table and the instance variables are lngInsuranceId,insuranceName,investmentAmount,investmentDate. I would like to delete a row from 'insurance' table.So I have a test class to delete a row from 'insurance' table.The test class is public static void main(String[] ...

7. How can i bolck a delete with hql?    forum.hibernate.org

On sql you can use de key ONDELETE and then you can set it on do nothing, cascade or in case there's some foreign key's block it. I'd like to know wether there is any way to set this last case on the Schema as well as you can set the cascade case. Thanks a lot!

8. Delete using hql with cascade="all-delete-orphan"    forum.hibernate.org

IMHO, you're bypassing Hibernate by using a delete query. This way, you're on your own. If you want Hibernate to take care of the relationships, I don't think you've got any way around loading the objects. But you probably don't have to load the objects in the collection as well, I think, the proxies will do just fine.

9. cascading hql delete    forum.hibernate.org





10. HQL delete throws "dialect not supporting temp tables&q    forum.hibernate.org

Hibernate version:3.0.5 I am trying to delete a large number of objects (5000+) in the database using the following HQL: delete from Eval where crRights = null and modRights = null and delRights = null and mpRights = null In the HQL above the class Eval has four bidirectional relationships with four different kinds of rights instances, and these relationships are ...

11. HQL question: deleting orphaned collection elements    forum.hibernate.org

...

12. HQL delete uses temporary tables when not nescesseary    forum.hibernate.org

I've just read article about bulk operations - http://blog.hibernate.org/cgi-bin/blosxom.cgi/2005/07/20 I mean that temporary tables are not nesceseary when: (a) delete by primary key (b) delete by condition from that you can derive set of primary keys to delete without data in delete table Examples: (a) delete from Human where id=10 (b) delete from Human as human where exists(select * from Order ...

13. please,hql delete problem    forum.hibernate.org

delete from BusinessRule br where exists( from QueryEvent q inner join q.BusinessRule qbr where qbr = br.Hjid ...

14. Can i do delete cacade in Hql?    forum.hibernate.org

I run hql delete A. In A mapping i set cascade all-delete-orphan , but the hql failed (FK constraints violation ). When i delete A with session.delete it delete A and his sons. is there any option to do this with Hql? (i need to delete big amount of obj) Thank you.

16. Problems using HQL with Cascaded Delete    forum.hibernate.org

Hi, I have defined a many to many relationship between two classes, viz. Event and Person (defined in a separate database table person_event). The code of these classes is listed at the end. When I tried using HQL query to delete an event, it came up with an exception. What I don't understand is that delete(event) works, but the HQL query ...





17. Quick HQL Deletes    forum.hibernate.org

The usual information about my setup including mapping docs are at the bottom of this post. My problem is this: I have a table with a relationship to another table. I would like to delete all the rows in those two tables with are related to eachother and one more table. Using Criteria's I can quite easily get the Entry objects ...

19. Problems with deleting objects with HQL    forum.hibernate.org

Hibernate version: 3.2.2 Mapping documents: Full stack trace of any exception that occurs: 18.12.2007 17:40:50 org.hibernate.util.JDBCExceptionReporter logExceptions WARNUNG: SQL Error: 547, SQLState: 23000 ...

20. Hibernate fails to execute HQL Delete    forum.hibernate.org

public static void main(String[] args) { Session s = HibernateUtil.getSessionFactory().getCurrentSession(); Transaction t = s.beginTransaction(); t.begin(); UsuarioGrupoDAO ugDAO = new UsuarioGrupoDAO(); ugDAO.deleteByHQL("delete UsuarioGrupo usuariorGrp"+ " ...

21. Hibernate: delete by HQL    forum.hibernate.org

Newbie Joined: Wed May 24, 2006 5:47 pm Posts: 14 Hi. I have this environmet: Hibernate 3.2.6 JVM 1.4.2_12 JBoss 4.0.5 Liferay 4.3.1 I have a one-to-many relation between an entity (called Ufficio) that is the parent and another entity (called Recapito) that is the child. I have these hbm: Ufficio.hbm.xml Code:

22. HQL Update/Delete Does Not Work the Same Way?    forum.hibernate.org

The first-level cache is tied to a single Session. If you have multiple sessions then you have multiple first-level caches as well. When a session dies, so does the first-level cache attached to it. The first level cache stores complete entities.The first-level cache grows as you load entities with the session. It doesn't have a limit on the number of objects ...