Hi Everybody,
I am really confused about to way to construct a custom SQL Mapping.
I have a View which brings me a collection of data from many tables. I created an Entity Class with all the properties return by the view.
So, I need to create a hbm.xml file to map this view to my class, but I´m having any doubts.
My code is:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Plafin.ENT.CashFlowContasParametrosENT,Plafin.ENT">
<loader query-ref="VW_CONSULTAR_CONTAS"/>
</class>
<sql-query name="VW_CONSULTAR_CONTAS">
<load-collection alias="Contas" role="Plafin.ENT.CashFlowContasENT" />
SELECT * FROM VW_CONSULTAR_CONTAS
</sql-query>
</hibernate-mapping>
I know that it is incomplete, but I tried almost everything without any success.
Can anyone help me ???
Thanks,
Oliver.
|