Hello
I have written a stored procedure which returns select from multiple tables. How can I return this resultset to java?
CREATE PROCEDURE [dbo].[spExtract2]
@param1 int,
@param2 varchar(255)
AS
begin
declare @t table(
expense_id VARCHAR(255),
type_name VARCHAR(255),
)
SELECT ex.expense_id, ext.type_name
FROM Expense ex, Expense_Type ext
WHERE ..............
return
end
---------------------------------------------------------------------------
<sql-query name="getExtract" callable="true">
<return class="Extract" alias="ex">
<return-property name="id" column="EXPENSE_ID"/>
<return-property name="type" column="type_name"/>
</return>
{call spExtract(?, :param1, :param2)}
</sql-query>
-------------------------------------------------------------------------------
Return class "Extract" has id and type mentioned. This is just a DTO to put all attributes and not a true entity that can be mapped to any table.
How can I make this query to return list of 'Extract' dtos which can not be really mapped to any table? This dto created just to return resultset.
This is just a sample and I have huge list of attributes in the resultset.
Thanks in advance
|