-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problem while populating grid using nHibernate
PostPosted: Mon Mar 07, 2011 5:47 am 
Newbie

Joined: Mon Dec 15, 2008 8:51 am
Posts: 3
Hello Everyone,

I am finding problem to bind datagrid. I am using nHibernate. I've two classes of one-t-many relationships. When i try to populate grid using nHibernate, i get following exception:

Exception:

NHibernate.PropertyAccessException: Invalid Cast (check your mapping for property type mismatches); setter of BusinessClassess.products ---> System.InvalidCastException: Unable to cast object of type 'NHibernate.Collection.PersistentSet' to type 'BusinessClassess.order'. at (Object , Object[] , SetterCallback ) at NHibernate.Bytecode.Lightweight.SetPropertyValuesInvoker.Invoke(Object obj, Object[] values, SetterCallback callback) at NHibernate.Bytecode.Lightweight.AccessOptimizer.SetPropertyValues(Object target, Object[] values) at NHibernate.Tuple.Entity.PocoEntityTuplizer.SetPropertyValuesWithOptimizer(Object entity, Object[] values) --- End of inner exception stack trace --- at NHibernate.Tuple.Entity.PocoEntityTuplizer.SetPropertyValuesWithOptimizer(Object entity, Object[] values) at NHibernate.Tuple.Entity.PocoEntityTuplizer.SetPropertyValues(Object entity, Object[] values) at NHibernate.Persister.Entity.AbstractEntityPersister.SetPropertyValues(Object obj, Object[] values, EntityMode entityMode) at NHibernate.Engine.TwoPhaseLoad.InitializeEntity(Object entity, Boolean readOnly, ISessionImplementor session, PreLoadEvent preLoadEvent, PostLoadEvent postLoadEvent) at NHibernate.Loader.Loader.InitializeEntitiesAndCollections(IList hydratedObjects, Object resultSetId, ISessionImplementor session, Boolean readOnly) at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) at NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters) at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes) at NHibernate.Hql.Classic.QueryTranslator.List(ISessionImplementor session, QueryParameters queryParameters) at NHibernate.Engine.Query.HQLQueryPlan.PerformList(QueryParameters queryParameters, ISessionImplementor session, IList results) at NHibernate.Impl.SessionImpl.List(String query, QueryParameters queryParameters, IList results) at NHibernate.Impl.SessionImpl.List[T](String query, QueryParameters parameters) at NHibernate.Impl.QueryImpl.List[T]() at BusinessClassess.products.selectProducts() in F:\Rnd Material\nHibernation\Sample Hibernate\ProductOrder\PointofSale\ProductOrders\BusinessClassess\products.cs:line 56 at WebApplication1.administrator.registerProducts.bindGrid() in F:\Rnd Material\nHibernation\Sample Hibernate\ProductOrder\PointofSale\ProductOrders\WebApplication1\administrator\registerProducts.aspx.cs:line 63
Can anyone help me regarding this issue. Its so urgent, so please help me to solve this issue. Waiting for quick response. Thanks in advance.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.