-->
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: how insert records stored in Linked List using NHibernate?
PostPosted: Fri Apr 09, 2010 5:56 pm 
Newbie

Joined: Fri Apr 09, 2010 5:31 pm
Posts: 1
I am trying to insert data stored in a link list into database using NHibernate via Fluenlty.
Here my code (simplified):

public static void SaveUpdate(object obj, bool doFlush)
{
using (var session = _sessionFactory.OpenSession())
{
session.SaveOrUpdate(obj); session.Flush();
}
}
Exception: No persister for: System.Collections.Generic.List`1[[BlueCrest.DataValidation.ValidationRuleDataModel.ValidationRuleBreakDetail, BlueCrest.DataValidation.VR_BreakDetail, Version=0.1.3751.29429, Culture=neutral, PublicKeyToken=null]]

Work around I found:
list.ForEach(l => SessionFactory.SaveUpdate(l));
SessionFactory.Flush();
But, I think this is saving one record at a time.

How can i insert the enitre list into database?
Thanks
Leonard


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.