max wrote:
btw. if you enable full debug for the persisters you get all the prepared sql hibernate will use for any DML operation (insert,update, delete etc.)
Very good idea and if your needs are small that is your fastest approach.
Its not actually that difficult to write some utility to sweep through and generate all the additional stored procedures. I auto-generate all my hibernate mappings, create the dbase, then sweep through again and add triggers to all the tables for logging/history/external-updates. (Actually, only the latter right now, but the others are coming along with minor effort.)
The best way to do this is instantiate a Configuration and step through it. It contains the contents of the hibernate-mapping, although substantially transformed. What you need is there, but you'll have to learn as you go. You're supposed to use the SessionFactory, but that requires PITA nonstandard hacking to get what you need. Private attributes and no access methods where you need them.
BTW, another reason DBAs require sprocs instead of raw SQL is for security. Its a PITA for all, but they have some valid ponts.