| Summary: | Creation of temporary tables for MySQL database update all query | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Ravi kiran N <ravikirann> | ||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||
| Status: | RESOLVED INVALID | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | ravikirann, tom.ware | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Ravi kiran N
Created attachment 173770 [details]
MySQL temporary table test case.
Any updates regarding this issue, we have an urgent requirement in our application. Is there a way to avoid creation of temporary tables and use update all JPQL query. Certain types of update and delete all statements (for instance for Entities mapped to multiple tables) require SQL that is more complex than a standard Update or Delete SQL statement - since multiple tables have to be somehow referenced and Update and Delete SQL statements only allow one table. We address this issue in one of two ways. 1. We use a Subquery in the Update or Delete statement. We do this for all databases that allowed the subquery at the time we wrote the feature. 2. If Subqueries are not allowed in Update or Delete statements, but temporary tables are allowed, we use temporary tables. That is what is happening with MySQL. In your example the reason multiple tables are needed is because your where clause navigates from Order to Customer. I am closing this bug as Invalid, but feel free to reopen if you can suggest a single line Update statement that works on MySQL. As already mentioned why can't we generate a sql query something like below, instead of using temporary tables. This works fine on MySQL platform. Using temporary tables is not an option as it will lead to performance issues. UPDATE CUSTOMER_BIDIRECTIONAL t0, ORDERS_BIDIRECTIONAL t1 SET t1.NAME='3' WHERE ((t0.ID = '1') AND (t0.ID = t1.CUSTOMER_ID)) The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |