nhibernate-mapping

Upgrade to NHibernate 3.2

谁说我不能喝 提交于 2020-01-25 12:22:48
问题 I have a project by NHibernate (version 2.1). For upgrade to NHibernate 3.2, what should I do? Do I need that upgrade following dll? Antlr3.Runtime Castle.Core Castle.DynamicProxy2 NHibernate.ByteCode.Castle I could not find those dll in NHibernate 3.2. Now what should I do? 回答1: They are not needed any more. Just delete all dlls that are not there any more (except maybe log4net, that's now optional but without it there won't be any logging). You might also get errors in your hibernate.cfg

Upgrade to NHibernate 3.2

♀尐吖头ヾ 提交于 2020-01-25 12:22:23
问题 I have a project by NHibernate (version 2.1). For upgrade to NHibernate 3.2, what should I do? Do I need that upgrade following dll? Antlr3.Runtime Castle.Core Castle.DynamicProxy2 NHibernate.ByteCode.Castle I could not find those dll in NHibernate 3.2. Now what should I do? 回答1: They are not needed any more. Just delete all dlls that are not there any more (except maybe log4net, that's now optional but without it there won't be any logging). You might also get errors in your hibernate.cfg

Fluent Nhibernate map list of lists

佐手、 提交于 2020-01-25 11:33:08
问题 I am writing mapping for the class with Fluent Nhibernate: public class UniqueFeaturesSet : IEntity { public UniqueFeaturesSet(List<List<double>> mfcc) { MFCC = mfcc; } public virtual List<List<double>> MFCC { get; set; } public virtual int Id { get; set; } } How to map List<List<double>> ? 回答1: It is not possible to map nested collections with [Fluent][N]Hibernate. The inner collection needs to be in an own class. 来源: https://stackoverflow.com/questions/10872334/fluent-nhibernate-map-list-of

Fluent Nhibernate map list of lists

扶醉桌前 提交于 2020-01-25 11:33:06
问题 I am writing mapping for the class with Fluent Nhibernate: public class UniqueFeaturesSet : IEntity { public UniqueFeaturesSet(List<List<double>> mfcc) { MFCC = mfcc; } public virtual List<List<double>> MFCC { get; set; } public virtual int Id { get; set; } } How to map List<List<double>> ? 回答1: It is not possible to map nested collections with [Fluent][N]Hibernate. The inner collection needs to be in an own class. 来源: https://stackoverflow.com/questions/10872334/fluent-nhibernate-map-list-of

nhibernate : how to initialise child list objects

喜夏-厌秋 提交于 2020-01-24 19:25:10
问题 I have the following method in my repository. This works fine, my orderItems are initialised as intended however orderItems contains another collection called OrderItemAddress. These are not initialised. How would i do this? public Model.Order Get(int id) { using (ISession session = NHibernateHelper.OpenSession()) { Model.Order order = session .CreateCriteria(typeof(Model.Order)) .Add(Restrictions.Eq("Id", id)) .UniqueResult<Model.Order>(); NHibernateUtil.Initialize(order.OrderItems); return

Is it one-to-one or Component ? Nhibernate Mapping

别说谁变了你拦得住时间么 提交于 2020-01-24 18:21:17
问题 Assume that I have Person and Address Classes and they have different tables in DB. One Person can have one Address Class in it. This is the important part for me. One Person can have only one Address as it s child element and i want to keep them in different tables in DB. Normally i know that i need to hold them in the same table, but my scenario needs this. (and also it looks like a one-to-many but i dont want to have a collection just for one object) Person Address ------- ------- id id

Error using NHibernate

蓝咒 提交于 2020-01-24 17:47:07
问题 Considering this example as a base example. I created the application but when I execute this application getting the following error. The ProxyFactoryFactory was not configured. Initialize 'proxyfactory.factory_class' property of the session-factory configuration section with one of the available NHibernate.ByteCode providers. Example: NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu Example: NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle

Any real use for table-per-concrete-class with implicit polymorphism?

*爱你&永不变心* 提交于 2020-01-24 14:07:38
问题 If mapping inheritance using table per concrete class, while mapping concrete classes simply just as any other class (without union-subclass), NHibernate allows same PKs across subclasses. For example if you have BillingDetails and subclasses CreditCard and BankAccount, requesting all BillingDetails will get you all records from both tables, which can in turn have duplicate primary keys, which can be problematic due to not valid business identity of those objects. This of course is not the

Any real use for table-per-concrete-class with implicit polymorphism?

浪子不回头ぞ 提交于 2020-01-24 14:05:09
问题 If mapping inheritance using table per concrete class, while mapping concrete classes simply just as any other class (without union-subclass), NHibernate allows same PKs across subclasses. For example if you have BillingDetails and subclasses CreditCard and BankAccount, requesting all BillingDetails will get you all records from both tables, which can in turn have duplicate primary keys, which can be problematic due to not valid business identity of those objects. This of course is not the

Any real use for table-per-concrete-class with implicit polymorphism?

假如想象 提交于 2020-01-24 14:04:04
问题 If mapping inheritance using table per concrete class, while mapping concrete classes simply just as any other class (without union-subclass), NHibernate allows same PKs across subclasses. For example if you have BillingDetails and subclasses CreditCard and BankAccount, requesting all BillingDetails will get you all records from both tables, which can in turn have duplicate primary keys, which can be problematic due to not valid business identity of those objects. This of course is not the