Statement « Delete « JPA Q&A





1. Hibernate: Update an object -> also unwanted delete statements are performed    stackoverflow.com

I am using Hibernate as an ORM in my Java application. I have a Project <-> Person manytomany-relation and the Project is the mapping owner. Now I have the problem, that I want ...

2. Deletes creating update statements    forum.hibernate.org

I'm trying to delete an entity and all of the related entities and when I show the sql that hibernate generates, it's showing update statements being created. This causes an issue because it's trying to update a foreign key with null. I have "cascade="all, delete-orphan"" on all of my one-to-many relationships and "cascade="all"" on the many-to-ones. I'm also using joined-subclasses that ...

3. update statement instead of delete    forum.hibernate.org

4. How execute a DELETE SQL statement ?    forum.hibernate.org

5. HQL delete statement not working    forum.hibernate.org

I got this damned exception. Caused by: java.lang.NoClassDefFoundError: antlr/ANTLRException at org.hibernate.hql.ast.ASTQueryTranslatorFactory.createQueryTranslator(ASTQueryTranslatorFactory.java:27) at org.hibernate.impl.SessionFactoryImpl.createQueryTranslators(SessionFactoryImpl.java:357) at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:423) at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74) at ar.com.argencard.sistemasInternos.serviceFramework.soporteNegocio.control.SolicitudManager.getSolicitudes(SolicitudManager.java:124) at ar.com.argencard.sistemasInternos.serviceFramework.soporteNegocio.service.SNOrquestadorNegocio.getSolicitudes(SNOrquestadorNegocio.java:77) at ar.com.argencard.sistemasInternos.serviceFramework.soporteNegocio.frontend.form.CatalogacionForm.getItemSolicitudesAbiertas(CatalogacionForm.java:81) ... 95 more ------------------------------------------------------------ I am using hibernate 3.05, and I cant get "CREATEQUERY" or CREATESQL" to work from SESSION class. I tried till my fingers worn out. I tried everything, but my code ...

6. Problems with Delete Statement    forum.hibernate.org

I want to delete an contact out of the contact table (Primary Key ConId) and i want to delete the entry out of the association table where the primary key of conID is the ID of the contact I want to delete and the primary key of partner is the ID of the partner I'm editing. When I just use session.delete ...

7. how do delete statement in hibernamte    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp hibernate 3 Mapping: code: package hibernateclasses; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import ...

8. Update statement created when deleting a collection.    forum.hibernate.org

Newbie Joined: Fri Jul 07, 2006 9:36 am Posts: 15 Hello, I am trying to delete a collection of a parent object and once I issue the delete and commit commands Hibernate throws a stack trace. I have looked into the issue and it appears that Hibernate is trying to execute an "UPDATE" statement with "nulls" in the key fields on ...

9. Objects still available after HQL delete statement    forum.hibernate.org

Hibernate version: 3.2.5.ga Code between sessionFactory.openSession() and session.close(): Session session1 = sessionManager.getCurrentSession(); Integer id = (Integer) session1.save( importObject ); session1.flush(); String hql = "DELETE FROM ImportObject"; session1.createQuery( hql ).executeUpdate(); session1.flush(); Session session2 = sessionManager.getCurrentSession(); session2.setCacheMode( CacheMode.IGNORE ); ImportObject o = (ImportObject) session2.get( ImportObject.class, id ); System.out.println( o.getId() ); // = 1 - why not nullpointerexception? Criteria c = session.createCriteria( ImportObject.class ); ...