[nhusers] Re: Missing AddAttribute method in FluentNHibernate 1.0 RC?

2009-08-18 Thread Jeffrey Zhao
Sorry, I mean the SetAttribute(s) method. Jeffrey Zhao Blog: http://www.cnblogs.com/JeffreyZhao Twitter: http://twitter.com/jeffz_cn -- From: "Jeffrey Zhao" Sent: Tuesday, August 18, 2009 6:28 PM To: Subject: [nhusers] Missing Ad

[nhusers] Missing AddAttribute method in FluentNHibernate 1.0 RC?

2009-08-18 Thread Jeffrey Zhao
Hello, I've upgraded to FluentNHibernate 1.0 RC and find the AddAttribute method is missing in OneToManyPart (and some other types). I used AddAttribute for the "sort" attribute of one-to-may mapping. How can I do with RC? Jeffrey Zhao Blog: http://www.cnblogs.com/JeffreyZha

[nhusers] Re: Lazy load of one-to-one association

2009-08-15 Thread Jeffrey Zhao
ent-layer based on ORM ;) ). 2009/8/15 Jeffrey Zhao Tried but nothing changed. Blog: http://www.cnblogs.com/JeffreyZhao/ Twitter: http://twitter.com/jeffz_cn -- From: "hival" Sent: Saturday, August 15, 2009 11:09 P

[nhusers] Re: Lazy load of one-to-one association

2009-08-15 Thread Jeffrey Zhao
And, if I set the Parent's id generate policy to "identity", an error "null id generated for:NHTest.Child" would be thrown. But things would be OK if I use "native" and provide an ID before saving. Blog: http://www.cnblogs.com/JeffreyZhao/ Twitter: http://twitter.com/jeffz_cn

[nhusers] Re: Lazy load of one-to-one association

2009-08-15 Thread Jeffrey Zhao
It's very weird. That's my mapping, can anyone find the difference? User But the SQL is still: SELECT this_.UserID as UserID0_1_, this_.Name as Name0_1_, userdetail2_.UserID as UserID1_0_, userd

[nhusers] Re: Lazy load of one-to-one association

2009-08-15 Thread Jeffrey Zhao
Tried but nothing changed. Blog: http://www.cnblogs.com/JeffreyZhao/ Twitter: http://twitter.com/jeffz_cn -- From: "hival" Sent: Saturday, August 15, 2009 11:09 PM To: "nhusers" Subject: [nhusers] Re: Lazy load of one-to-one association > > Try

[nhusers] Lazy load of one-to-one association

2009-08-15 Thread Jeffrey Zhao
I've an one-to-one assocation and tried to get lazy load. I get a lot of information of (N)Hibernate from search engine, but it confused me even more. Some people say that I cannot get this but some others say yes. I tried with these information but failed. Here's what I use as the model: publi

[nhusers] Re: Use NHibernate.Linq to get single entity with eager load

2009-08-14 Thread Jeffrey Zhao
t is different, then the problem is the Linq 2009/8/15 Jeffrey Zhao Hello, I met a problem when use NHibernate.Linq to get single entity with eager load. For example I've a the models like: public class Product { ... } public class Product { public virtual int ProductID {

[nhusers] Use NHibernate.Linq to get single entity with eager load

2009-08-14 Thread Jeffrey Zhao
Hello, I met a problem when use NHibernate.Linq to get single entity with eager load. For example I've a the models like: public class Product { ... } public class Product { public virtual int ProductID { get; set; } public virtual string Name { get; set; } public virtual ISet Propert

[nhusers] Re: How can I JUST delete an entity using NHibernate

2009-08-14 Thread Jeffrey Zhao
Everything's fine after creating an bi-directional association with an IList in model. Thanks, Stefan. Blog: http://www.cnblogs.com/JeffreyZhao/ Twitter: http://twitter.com/jeffz_cn -- From: "Jeffrey Zhao" Sent: Friday, August

[nhusers] Re: How can I JUST delete an entity using NHibernate

2009-08-14 Thread Jeffrey Zhao
; { >public virtual string Name { get; set; } > } > > And the table would have this columns: > > ProductId (foreign key to product) > SortOrder > Name > > > On 14 Aug., 14:44, "Jeffrey Zhao" wrote: >> For the last question, the reason I use &q

[nhusers] Re: How can I JUST delete an entity using NHibernate

2009-08-14 Thread Jeffrey Zhao
Friday, August 14, 2009 5:59 PM >> To: "nhusers" >> Subject: [nhusers] Re: How can I JUST delete an entity using NHibernate >> >> >> >> > Try >> >> > Product product = session.Load(1); >> > session.Delete(product); >> &

[nhusers] Re: How can I JUST delete an entity using NHibernate

2009-08-14 Thread Jeffrey Zhao
y for the Product 8assuming you > are using lazy loading). Then you can remove it. > > then you can use on-delete in the mapping to let the database clean up > referenced records: > http://vanryswyckjan.blogspot.com/2008/04/nhibernate-20-and-cascading-deletes.html > > > On 1

[nhusers] How can I JUST delete an entity using NHibernate

2009-08-14 Thread Jeffrey Zhao
Hello, I'm a new for NH and I met the problem of "how can I delete an entity". For example, I've got two entity with an one-to-many association. Here's the sql to build the table (omit the association): CREATE TABLE [dbo].[Property]( [PropertyID] [int] IDENTITY(1,1) NOT NULL, [ProductID]

[nhusers] Re: Mapping one-to-one relationship in a single table

2009-08-10 Thread Jeffrey Zhao
Subject: [nhusers] Re: Mapping one-to-one relationship in a single table lazy loading for components does not have any sense. 2009/8/10 Jeffrey Zhao But component mapping cannot implement lazy load. Any ways to get both single table one-to-one mapping and lazy load? Jeffrey Zhao

[nhusers] Re: Mapping one-to-one relationship in a single table

2009-08-10 Thread Jeffrey Zhao
Subject: [nhusers] Re: Mapping one-to-one relationship in a single table lazy loading for components does not have any sense. 2009/8/10 Jeffrey Zhao But component mapping cannot implement lazy load. Any ways to get both single table one-to-one mapping and lazy load? Jeffrey Zhao

[nhusers] Re: Mapping one-to-one relationship in a single table

2009-08-10 Thread Jeffrey Zhao
But component mapping cannot implement lazy load. Any ways to get both single table one-to-one mapping and lazy load? Jeffrey Zhao Blog: http://www.cnblogs.com/JeffreyZhao/ Twitter: http://twitter.com/jeffz_cn -- From: "hival" Se

[nhusers] Mapping one-to-one relationship in a single table.

2009-08-10 Thread Jeffrey Zhao
ProductID NamePrice CreateTime LastUpdated 1 123 123.0 2009:xx:xx 2009:xx:xx Thanks Jeffrey Zhao Blog: http://www.cnblogs.com/JeffreyZhao Twitter: http://twitter.com/jeffz_cn --~--~-~--~~~---~--~~ You received this message because you are subscr