nhibernate-3

Eager load while using Linq in NHibernate 3

泪湿孤枕 提交于 2019-11-30 15:10:02
问题 I need help with eager loading in with Linq in NHibernate 3 trunk version. I have a many-to-many relationship like this: public class Post { public int Id {get;set;} public IList<Tag> Tags { get;set;} . . . } Now I have the following mapping in Fluent NHibernate public class PostMap:ClassMap<Post> { public PostMap() { Table("Posts"); Id(x => x.Id); . . HasManyToMany(x => x.Tags) .Table("PostsTags") .ParentKeyColumn("PostId") .ChildKeyColumn("TagId") .Not.LazyLoad(); // this is not working.. }

Eager load while using Linq in NHibernate 3

这一生的挚爱 提交于 2019-11-30 13:28:11
I need help with eager loading in with Linq in NHibernate 3 trunk version. I have a many-to-many relationship like this: public class Post { public int Id {get;set;} public IList<Tag> Tags { get;set;} . . . } Now I have the following mapping in Fluent NHibernate public class PostMap:ClassMap<Post> { public PostMap() { Table("Posts"); Id(x => x.Id); . . HasManyToMany(x => x.Tags) .Table("PostsTags") .ParentKeyColumn("PostId") .ChildKeyColumn("TagId") .Not.LazyLoad(); // this is not working.. } } Now while fetching the posts, I need the Tags also to eager load. I know that it is possible with

NHibernate 3.2 many to many mapping by code

房东的猫 提交于 2019-11-29 02:01:33
I'm trying to learn NHibernate 3.2 built-in mapping by code api ( NOT FluentNHibernate, nor xml). Can you help me to map a many-to-many relationship between these entities please? public class Post { public virtual Id { get; set; } public IList<Tag> Tags { get; set; } } public class Tag { public virtual Id { get; set; } public IList<Post> Posts { get; set; } } My primary key strategy is: Id( t => t.Id, t => { t.Generator(Generators.HighLow, g => g.Params(new { max_low = 100 })); t.Column(typeof(TEntity).Name + "Id"); }); and I try this: // TagMap : ClassMapping<Tag> Bag(t => t.Posts, bag => {

NHibernate + WCF + Windows Service and WcfOperationSessionContext class

ε祈祈猫儿з 提交于 2019-11-27 19:55:50
I have a Windows Service Application in which i create WCF services in it. One of the services is data services: add, delete, read , updatte data via WCF. WCF use NHibernate for data manipulation So my guestions are: Any advice (best practice) for session management for Hibernate using with WCF? Anybody knows anything about WcfOperationSessionContext (hibernate 3.0) class? how to use it with WCF? Well to make it concrete : Suppose that i have WCF Service called DataServices class WCFDataService ..... { void SaveMyEntity(MyEntity entity) { .....................?? // How to do? Best Way //

NHibernate 3.2 many to many mapping by code

对着背影说爱祢 提交于 2019-11-27 16:23:43
问题 I'm trying to learn NHibernate 3.2 built-in mapping by code api ( NOT FluentNHibernate, nor xml). Can you help me to map a many-to-many relationship between these entities please? public class Post { public virtual Id { get; set; } public IList<Tag> Tags { get; set; } } public class Tag { public virtual Id { get; set; } public IList<Post> Posts { get; set; } } My primary key strategy is: Id( t => t.Id, t => { t.Generator(Generators.HighLow, g => g.Params(new { max_low = 100 })); t.Column

NHibernate + WCF + Windows Service and WcfOperationSessionContext class

不想你离开。 提交于 2019-11-26 22:51:32
问题 I have a Windows Service Application in which i create WCF services in it. One of the services is data services: add, delete, read , updatte data via WCF. WCF use NHibernate for data manipulation So my guestions are: Any advice (best practice) for session management for Hibernate using with WCF? Anybody knows anything about WcfOperationSessionContext (hibernate 3.0) class? how to use it with WCF? Well to make it concrete : Suppose that i have WCF Service called DataServices class