[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 je...@live.com Sent: Tuesday, August 18, 2009 6:28 PM To: nhusers@googlegroups.com Subject

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

2009-08-15 Thread Jeffrey Zhao
, then the problem is the Linq 2009/8/15 Jeffrey Zhao je...@live.com 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

[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:

[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? hibernate-mapping xmlns=urn:nhibernate-mapping-2.2 assembly=NHTest namespace=NHTest class name=User table=`User` id name=UserID type=Int32 column=UserID generator class=identity / /id one-to-one name=Detail

[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
a persistent-layer based on ORM ;) ). 2009/8/15 Jeffrey Zhao je...@live.com Tried but nothing changed. Blog: http://www.cnblogs.com/JeffreyZhao/ Twitter: http://twitter.com/jeffz_cn -- From: hival hi...@ukr.net Sent: Saturday

[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: How can I JUST delete an entity using NHibernate

2009-08-14 Thread Jeffrey Zhao
://vanryswyckjan.blogspot.com/2008/04/nhibernate-20-and-cascading-deletes.html On 14 Aug., 11:12, Jeffrey Zhao je...@live.com wrote: 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

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

2009-08-14 Thread Jeffrey Zhao
/set This makes it a list of value-type-alike instances. Property will not have an id anymore. See http://nhforge.org/doc/nh/en/index.html#components And - why is it a set if you need a sort order? It should probably be a list. On 14 Aug., 12:38, Jeffrey Zhao je...@live.com wrote

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

2009-08-14 Thread Jeffrey Zhao
Property { 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 je...@live.com wrote: For the last question, the reason I use Set is that List in NH mapping has an index. I

[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 IListProperty in model. Thanks, Stefan. Blog: http://www.cnblogs.com/JeffreyZhao/ Twitter: http://twitter.com/jeffz_cn -- From: Jeffrey Zhao je...@live.com Sent: Friday

[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

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

2009-08-10 Thread Jeffrey Zhao
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 subscribed to the Google Groups

[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 hi...@ukr.net Sent

[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 je...@live.com But component mapping cannot implement lazy load. Any ways to get both single table one-to-one mapping and lazy load

[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 je...@live.com But component mapping cannot implement lazy load. Any ways to get both single table one-to-one mapping and lazy load