nhibernate

How to escape colon (:) character while executing native SQL queries against an Informix database using NHibernate?

故事扮演 提交于 2020-01-04 18:17:26
问题 I'm trying to execute a set of native SQL queries against an Informix database, using NHibernate to create the queries. However, NHibernate is set to change the query if it contains colons (they are supposedly reserved characters), and so the query fails. This is a sample of the native SQL query: CREATE PROCEDURE procedure_name() ... SELECT FIRST id :: INTEGER INTO variable ... END PROCEDURE; which NHibernate transforms into this, before executing the query, CREATE PROCEDURE procedure_name()

Lazy loading of fields that are part of the main record

心已入冬 提交于 2020-01-04 15:58:21
问题 I'm a relative newbie at NHibernate, so I'll beg forgiveness in advance if this a stupid question. I've googled it and searched the documentation, and am getting all wrapped around the axle. I'm maintaining/enhancing an existing application that uses NHibernate for a relatively straightforward table. The table has about 10-12 fields, and no foreign key relations. The table contains somewhere around a dozen or so rows, give or take. Two of the fields are huge blobs (multi-megabytes). As a

Lazy loading of fields that are part of the main record

▼魔方 西西 提交于 2020-01-04 15:58:04
问题 I'm a relative newbie at NHibernate, so I'll beg forgiveness in advance if this a stupid question. I've googled it and searched the documentation, and am getting all wrapped around the axle. I'm maintaining/enhancing an existing application that uses NHibernate for a relatively straightforward table. The table has about 10-12 fields, and no foreign key relations. The table contains somewhere around a dozen or so rows, give or take. Two of the fields are huge blobs (multi-megabytes). As a

Implementing IDataErrorInfo using Castle.DynamicProxy in lazy loading scenario using NHibernate

僤鯓⒐⒋嵵緔 提交于 2020-01-04 14:20:35
问题 I have implemented IDataErrorInfo interface using Castle.DynamicProxy IIterceptor. I have also implemented a NHibernate interceptor which instantiates my entities using this interceptor. The problem is with lazy loaded entities. These are constructed using a proxy factory class specified in nhibernate config file, which obviously does not provide IDataErrorInfo implementation. This proxies are masking the underlying implementation of IDataErrorInfo by my interceptor which causes the

ninject inject iunitofwork to repository scoped attribute

风流意气都作罢 提交于 2020-01-04 11:08:14
问题 Let me start with my current setup, and then explain what I am trying to achieve. We are using NHibernate and trying to implement the IRepository/IUnitOfWork pattern with Ninject. It should ideally work generically for whatever application is using the code, whether is ASP.Net, WCF or something else. IUnitOfWork public interface IUnitOfWork { object Add(object obj);//all other supported CRUD operations we want to expose void Commit(); void Rollback(); } UnitOfWork public class UnitOfWork :

NHibernate proxyexception

家住魔仙堡 提交于 2020-01-04 08:24:07
问题 I am new NHibernate.I am writing the simple application that have cusstomer class contains id and name and using nhibernate i am storing the object to database. but i am getting the following 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: <property name='proxyfactory.factory_class'>NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate

NHibernate proxyexception

丶灬走出姿态 提交于 2020-01-04 08:22:09
问题 I am new NHibernate.I am writing the simple application that have cusstomer class contains id and name and using nhibernate i am storing the object to database. but i am getting the following 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: <property name='proxyfactory.factory_class'>NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate

NHibernate, ISession per presenter, multiple presenters open

狂风中的少年 提交于 2020-01-04 07:58:30
问题 How would you solve the following situation: the app is MVP based (WinForms) and at the same time I can have multiple presenters showing. Each presenter has a session attached, and open during the lifetime of the presenter. If I load an entity in one presenter and pass it through to another to show it, and if that entity has some collection to it, I get "Illegal attempt to associate a collection with two open sessions". Now, am I doing something wrong with my architecture? I don't see a

How do I create a NHibernate Mapping file for a multi-value component that is a Unique set of columns?

末鹿安然 提交于 2020-01-04 06:50:11
问题 I'm using NHibernate and Fluent NHibernate to create a mapping file for a domain object (though I don't care if an answer uses fluent NHibernate or xml hbm syntax). And I'm having trouble with figuring out how I specify that a set of columns representing a component within the domain object is unique. Here's the domain object: public class SpaceLocation { public SpaceCoordinate Coordinates { get; set; } public SpaceObject AtLocation { get; set; } } and here is the component I'm having trouble

NHibernate join and projection properties

一世执手 提交于 2020-01-04 06:26:49
问题 I have simple situation (like on the image link text) and simple SQL query SELECT M.Name, A.Name, B.Name FROM Master M LEFT JOIN DetailA A ON M.DescA = A.Id LEFT JOIN DetailB B ON M.DescB = B.Id How to achive the same effect in nHibernate using CriteriaAPI ? I have something like this: public class Employee : ClassBase, IContactData { public virtual string FirstName { get; set; } public virtual string MiddleName { get; set; } public virtual string LastName { get; set; } public virtual string