I define a named sql-query mapping which calls a stored function with various parameters.
In my stored function I insert a new row in a table. As the DB has triggers which modifies some columns I then return a cursor to the newly inserted row.
To call this from java I do:
Code:
Query query = session.getNamedQuery("insert-and-return");
q.setString("param1", "something");
q.setString("param2", "somethingElse");
List insertedRows = query.list();
What are the implications of doing an insert / update in the stored function even though my java code looks like it's doing a query. Apart from being confusing to read.