c# - Errors in named query (NHibernate) -
using hbm file:
<?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping assembly="brokerplatform.core" namespace="brokerplatform.core.model.common" xmlns="urn:nhibernate-mapping-2.2"> <import class="ratingdto, brokerplatform.core"/> <import class="clientdto, brokerplatform.core"/> <import class="documentdto, brokerplatform.core"/> <import class="userdto, brokerplatform.core"/> <resultset name="ratingsresultset"> <return alias="rv" class="ratingdto, brokerplatform.core"> <return-property column="rv.id_rating" name="id_rating" /> <return-property column="rv.total" name="total" /> <return-property column="rv.rating" name="rating"></return-property> </return> <return-join alias="u" property="rv.user"> <return-property column="u.username" name="username"></return-property> <return-property column="u.id_user" name="id_user"></return-property> </return-join> <return-join alias="c" property="rv.client"> <return-property column="c.cnpcui" name="cnpcui"></return-property> <return-property column="c.name" name="name"></return-property> <return-property column="c.datanasterii" name="datanasterii"></return-property> <return-property column="c.telefon" name="telefon"></return-property> <return-property column="c.email" name="email"></return-property> </return-join> <return-join alias="dv" property="rv.documents"> <return-property column="dv.id_document" name="id_document"></return-property> <return-property column="dv.name" name="name"></return-property> <return-property column="dv.enddate" name="enddate"></return-property> <return-property column="dv.numarpolita" name="numarpolita"></return-property> </return-join> </resultset> <sql-query name="getratingclienti" resultset-ref="ratingsresultset" cacheable="true" cache-mode="normal"> <query-param name="itemsperpage" type="system.int32" /> <query-param name="page" type="system.int32" /> <query-param name="id_produs" type="system.int32" /> <query-param name="cnpcui" type="system.string" /> <query-param name="email" type="system.string" /> <query-param name="marca" type="system.string"/> <query-param name="numarinmatriculare" type="system.string"/> <query-param name="seriesasiu" type="system.string"/> <query-param name="policydate" type="system.datetime"/> <query-param name="id_user" type="system.int32"/> exec dbo.getratingclient @itemsperpage = :itemsperpage, @page = :page,@id_produs = :id_produs,@cnpcui = :cnpcui,@email = :email,@marca = :marca,@numarinmatriculare = :numarinmatriculare,@seriesasiu = :seriesasiu,@policydate = :policydate,@id_user = :id_user </sql-query> <!--<sql-query name="getratingclient"> <return alias="rv" class="ratingdto"> <return-property column="rv.id_rating" name="id_rating" /> <return-property column="rv.total" name="total" /> <return-property column="rv.rating" name="rating"></return-property> </return> <return-join alias="u" property="ratingdto.user"> <return-property column="u.username" name="username"></return-property> <return-property column="u.id_user" name="id_user"></return-property> </return-join> <return-join alias="c" property="ratingdto.client"> <return-property column="c.cnpcui" name="cnpcui"></return-property> <return-property column="c.name" name="name"></return-property> <return-property column="c.datanasterii" name="datanasterii"></return-property> <return-property column="c.telefon" name="telefon"></return-property> <return-property column="c.email" name="email"></return-property> </return-join> <return-join alias="dv" property="ratingdto.documents"> <return-property column="dv.id_document" name="id_document"></return-property> <return-property column="dv.name" name="name"></return-property> <return-property column="dv.enddate" name="enddate"></return-property> <return-property column="dv.numarpolita" name="numarpolita"></return-property> </return-join> exec dbo.getratingclient :itemsperpage, :page, :id_produs, :cnpcui, :email, :marca, :numarinmatriculare, :seriesasiu, :policydate, :id_user </sql-query>--> </hibernate-mapping>
i receive generic error message says there errors in getratingclient. in xml above, have used 2 different mapping, no success. doing wrong? , yeah, it's .hbm file, set embedded content. dto's classes not mapped persistent entities.
the error is: {"errors in named queries: {getratingclienti}"} , stacktrace:
at nhibernate.impl.sessionfactoryimpl..ctor(configuration cfg, imapping mapping, settings settings, eventlisteners listeners) in c:\users\oskar.berggren\documents\projects\nhibernate-core-3\src\nhibernate\impl\sessionfactoryimpl.cs:line 372 @ nhibernate.cfg.configuration.buildsessionfactory() in c:\users\oskar.berggren\documents\projects\nhibernate-core-3\src\nhibernate\cfg\configuration.cs:line 1258 @ brokerplatform.infrastructure.platformsessionfactorystorage.createsessionfactory(iappinstance appinstance) in d:\asdf\trunk\brokerplatform\brokerplatform.infrastructure\contextstorage\brokersessionfactorystorage.cs:line 54 @ brokerplatform.infrastructure.platformsessionfactorystorage.getsessionfactory(iappinstance instance, boolean& newlycreated) in d:\asdf\trunk\brokerplatform\brokerplatform.infrastructure\contextstorage\brokersessionfactorystorage.cs:line 175
Comments
Post a Comment