Customizing SQL … from USERS us where us.RANKING >= @IN_RANK Let s map this stored procedure to a named query in Hibernate. Querying with a procedure A stored procedure for querying is mapped as a regular named query, with some minor differences: { call SELECT_USERS_BY_RANK(?, :rank) } The first difference, compared to a regular SQL query mapping, is the callable=”true” attribute. This enables support for callable statements in Hibernate and correct handling of the output of the stored procedure. The following mappings bind the column names returned in the procedures result to the properties of a User object. One special case needs extra consideration: If multicolumn properties, including components (homeAddress), are present in the class, you need to map their columns in the right order. For example, the homeAddress property is mapped as a with three properties, each to its own
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.
This entry was posted
on Saturday, March 8th, 2008 at 1:11 pm and is filed under PHP5.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.