Hi guys,
I'm (rather) new to Hibernate. I've got a medium-sized project going on at university where we're using Hibernate 3.0 (we had little choice here) and we also had to use the javax.persistence-annotations - so a very restricted environment. Our program requires a rather complex logic when it comes to deleting objects / entries on the underlying MySQL database, so we decided to write the logic in our java client (we have no server-side java program running, only the database is running on a server) using native MySQL delete and update queries. Which works. However, as our logic is complex, the number of individual DELETE-queries is rather large. Often we need 10 or more of them to delete a single object.
As far as I know, in regular MySQL query syntax, one may write several queries into one by separating them using ";". This would be a HUGE help to us in increasing performance as instead of crossing the network 10 times we would only have to cross it ONCE. So we would have queries like this:
DELETE FROM a WHERE b; DELETE FROM c WHERE d; DELETE ... etc. with a, b, c, d as placeholders.
But, it seems as if Hibernate would not support this. Every time I write a ";" it tells me that the queries MySQL syntax is wrong. Does Hibernate use a different separator than ";"? Or is there a way to "batch-process" multiple native queries so that the network delay would become active only once?
Thanks in advance,
Alan
|