Question

Is there a possibility to call a stored function (MySql Server) via Spring/Hibernate?

The function gets two parameter (int, varchar(20)) and returns a varchar(255), I think there must me a possibility with named-query but I have no idea how to generate the mapping.

Was it helpful?

Solution

You might have to wrap the stored procedure in another stored procedure that returns a resultset.

See Hibernate Core Reference Chapter 18 for info on named queries and calling stored procedures.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top