mysql « Delete « JPA Q&A





1. Cannot delete or update a parent row - JPA with Hibernate    stackoverflow.com

I have a database in which all of the tables have been generated by Java JPA/Hibernate code. I need to update several tables in my database in a fashion similar to ...

2. Cannot delete a database object after restarting the application    stackoverflow.com

We have a Java application that uses Hibernate and a MySQL database. Delete transactions appear to work fine at first. But, if we exit our application and restart it, we are ...

3. Wrong behavior for cascade delete-orphan on Mysql and Derby    forum.hibernate.org

Hi all, I have two tables "Securites" and "TradeList" . They are linked together creating a new table "SecurityTradeList" in a bi-directional association. The problem is that the cascade delete works fine when I use MYSQL and works different when I use Apache Derby. When I delete a record on the TradeList, MySQL deletes only the record I selected and the ...

4. MySQL Delete Problems With Hibernate 3.3.0    forum.hibernate.org

You cannot have JoinColumn on both tables. Leave the JoinColumn on the child table, which I think in this case is the Record and add a mappedBy property on the Owner table, which I think is the User table. The reason you are having trouble is because the layout you have right now says that they both depend on each other ...

5. Row in a mysql table not really deleted    forum.hibernate.org

Hello, I'm trying to fix some code I inherited - this is my first experience with Hibernate. I'm trying to delete a row from a mysql table, but the row does not get deleted. Instead, most of the values in the columns are changed to NULL. Has anyone seen this, or know what the problem might be? I'm using Hibernate 3 ...

6. ..I cannot Delete from MySQL using Hibernate :(    forum.hibernate.org

..i cannot execute multiple delete using hibernate Hibernate version: 3 here is my codes: from JSP page to get the check values: String deleteArray[] = request.getParameterValues("chkor"); String selected=""; if(deleteArray.length == 1) { // Only one item is selected selected = deleteArray[0]; } else { // multiple items selected for (int i = 0; i < deleteArray.length; i++) { selected += deleteArray[i]; ...

7. Cant delete from Table in MySQL    forum.hibernate.org

Hi I have a little problem, im trying to delete several records from a table, but it give me a exception. My version of Hibernate is v 3.x Here is my code: public void deleteByUser(long userRecordId) { try { Session session = (Session) HibernateSessionFactory .currentSession(); Transaction tx = session.beginTransaction(); Long user = new Long(userRecordId); Query q = session.createQuery( "delete from tmpimage ...

8. Cant delete from Table in MySQL    forum.hibernate.org

Hi I have a little problem, im trying to delete several records from a table, but it give me a exception. My version of Hibernate is v 3.x Here is my code: public void deleteByUser(long userRecordId) { try { Session session = (Session) HibernateSessionFactory .currentSession(); Transaction tx = session.beginTransaction(); Long user = new Long(userRecordId); Query q = session.createQuery( "delete from tmpimage ...

9. Cant delete from Table in MySQL    forum.hibernate.org

Hi I have a little problem, im trying to delete several records from a table, but it give me a exception. My version of Hibernate is v 3.x Here is my code: public void deleteByUser(long userRecordId) { try { Session session = (Session) HibernateSessionFactory .currentSession(); Transaction tx = session.beginTransaction(); Long user = new Long(userRecordId); Query q = session.createQuery( "delete from tmpimage ...





10. Problem with Bulk Delete in MySQL 5    forum.hibernate.org

Hibernate version: 3.2 CR5 with MySQL 5 When I execute some bulk delete HQL statement such as String hqlStatement = "delete Agent"; Query query = session.createQuery(hqlStatement); int updatedEntities = query.executeUpdate(); There is a SQLGrammarProblem: Hibernate: insert into HT_PTY_PartyRole select agentimpl0_.oid as oid from PTY_PartyRole agentimpl0_ inner join PTY_Agent agentimpl0_1_ on agentimpl0_.oid=agentimpl0_1_.partyRoleId where dt='AG' [main] 13:47:56 WARN (JDBCExceptionReporter.logExceptions:71) - SQL Error: 1146, ...

11. Hibernate + Mysql error on deleting rows    forum.hibernate.org

Hi, i am using hibernate with MySQL 5.0.20. I have a BaseBean class that is parent for all of classes i am using, and that class has @Id notation. So basically my classes pickup Id from that class. I am using MySQL Dialect. When Hibernate create tables and i populate it with data (it works well) and when i try to ...

12. MySQL Dialect Bulk Delete/Edit    forum.hibernate.org

Author Message illya77 Post subject: MySQL Dialect Bulk Delete/Edit Posted: Wed Apr 09, 2008 4:57 am Newbie Joined: Wed Apr 09, 2008 4:19 am Posts: 3 Hello, Does Hibernate support Temp Table wrapping for MySQL Bulk/Delete queries? EJB QL: Code: DELETE AlertConditionLog acl WHERE acl.id IN ( ...

13. MySql Foreign Key On Delete Cascade - unable to enable it    forum.hibernate.org

Newbie Joined: Fri Nov 28, 2008 4:01 pm Posts: 2 Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp [b]Hibernate version:[/b] 3.3.1 [b]Mapping documents:[/b] [b]Code between sessionFactory.openSession() and session.close():[/b] rqConfig.addAnnotatedClass(ResvSessionModel.class); // this tells to hibernate how our table look like rqConfig.addAnnotatedClass(ResvFlowModel.class); rqConfig.configure(); // this configures hibernate to use our table // definition via our object class // Create the table ...