fluent-nhibernate

How to make Fluent NHibernate ignore Dictionary properties

I'm trying to make Fluent NHibernate's automapping ignore a Dictionary property on one of my classes, but Fluent is ignoring me instead. Ignoring other types of properties seems to work fine, but even after following the documentation and adding an override for the Dictionary, I still get the following exception when BuildSessionFactory ...

LockMode With Subclasses

I'm using Fluent Nhibernate with the following query on DerivedClass which extends BaseClass: var query = Session.CreateCriteria<DerivedClass>().SetLockMode(LockMode.Upgrade) What I want is the lock hints (updlock, rowlock) to be applied to both DerivedClass and BaseClass, but the generated SQL only applies the lock hints to DerivedCla...

Fluent NHibernate no data being returned

Hello, I have been successfully using NHibernate, but now I am trying to move to Fluent NHibernate. I have created all of my mapping files and set up my session manager to use a Fluent Configuration. I then run my application and it runs successfully, but no data is returned. There are no errors or any indication that there is a proble...

WCF Proxy Error

I am a WCF newb so I am having trouble deciphering the error. The case is this: I invoke my service through the WCF test client.Just testing at this point The service invocation bascially requires one parameter which is a scenario name. This is contained in the ScenarioRequest type ( see error below). The analytics service then uses f...

Fluent NHibernate is bringing ClassMap Id and SubClassMap Id to referenced table?

HI, I have the following entities I'm trying to map: public class Product { public int ProductId { get; private set; } public string Name { get; set; } } public class SpecialProduct : Product { public ICollection<Option> Options { get; private set; } } public class Option { public int OptionId { get; private set; } } An...

How to configure a generic component with FluentNHibernate ?

Here is the component for which I want to configure mapping public class Range<T> : ValueObject { public virtual T Start {get; set;} public virtual T Finish {get; set;} } In my domain I have many entities which have properties like Range < DateTime>, Range < int > ... for a particular class with property x we configure the c...

How to create reference tables using fluent nhibernate

How can i create a 3 table schema from the following model classes. public class Product { public int Id {get; set;} public string Name {get; set;} public IList<Photo> Photos {get; set;} } public class Photo { public int Id {get; set;} public string Path {get; set;} } I want to create the following table structure in the da...

FluentNHibernate Many-To-One References where Foreign Key is not to Primary Key and column names are different

I've been sitting here for an hour trying to figure this out... I've got 2 tables (abbreviated): CREATE TABLE TRUST ( TRUSTID NUMBER NOT NULL, ACCTNBR VARCHAR(25) NOT NULL ) CONSTRAINT TRUST_PK PRIMARY KEY (TRUSTID) CREATE TABLE ACCOUNTHISTORY ( ID NUMBER NOT NULL, ACCOUNTNUMBER VARCHAR(25) NOT NULL, TRANSAMT NUMBER(38,2) NOT NULL PO...

Fluent composite foreign key mapping

Hi, I wonder if this is possible to map the following with fluent nhibernate: A document table and a document_revision table will be the target tables. The document_revision table should have a composite unique key consisting of the document_id and the revision number (where the document_id is also the foreign key to the document tabl...

How to access the backing field of a base class using fluent nhibernate?

How do i set the Access Strategy in the mapping class to point to the base _photos field? public class Content { private IList<Photo> _photos; public Content() { _photos = new List<Photo>(); } public virtual IEnumerable<Photo> Photos { get { return _photos; } } public virtual void AddPhoto() {...}...

AutoMapping Custom Collections with FluentNHibernate

I am retrofitting a very large application to use NHibernate as it's data access strategy. Everything is going well with AutoMapping. Luckily when the domain layer was built, we used a code generator. The main issue that I am running into now is that every collection is hidden behind a custom class that derives from List<>. For example ...

How to fix issue with decimal values in Sybase ODBC driver using NHibernate?

Sybase ODBC driver have an issue with the decimal data type. For example, when an application is trying to save in the database a decimal value occurs this error: ERROR [22018] [DataDirect][ODBC Sybase Wire Protocol driver][SQL Server]Implicit conversion from datatype 'VARCHAR' to 'DECIMAL' is not allowed. Use the CONVERT function to...

Problem with nhibernate join

I'm trying to do a join like this using fluent nhibernate: Id(x => x.Id); Map(x => x.SourceSystemRecordId,"sourceSystemRecord_id"); Then Join("cat.tbl_SourceSystemRecords", SourceSystemRecords); But, it seems I don't have a way to specify the column I want to join with from the first table, in this case I need to join on SourceSyst...

FluentNHibernate 1.1 / Castle 1.1 dependency

I would like to upgrade my FluentNHibernate to version 1.1, but I found out it uses Castle.Core 1.1. I use Castle.Windsor 1.2 in my app which works with Castle.Core 1.2. I now need to find a version of Castle.Windsor that uses this earlier version of Castle.Core, but I can't find it anywhere. What do you recommend I should do? Wait...

How to set custom DriverConnectionProvider with Fluent NHibernate

Hi guys, How to set custom DriverConnectionProvider with Fluent NHibernate? Best regards, Alexey Zakharov ...

fluentnhibernate ManyToMany does not add records to the junction table

When saving my many-to-many related entities, the entities are saved ok. However the junction table stays empty: Mapping on Product side (ProductMap.cs) HasManyToMany(x => x.Pictures) .Table("Product_Picture") .ParentKeyColumn("Product") .ChildKeyColumn("Picture") .Cascade.All() .Inverse() This produces the following xml: <bag cas...

FluentNHibernate, getting 1 column from another table

We're using FluentNHibernate and we have run into a problem where our object model requires data from two tables like so: public class MyModel { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual int FooId { get; set; } public virtual string FooName { get; set; } } Where there is a ...

Set property with reflection after Fluent Nhibernates automapping has occured?

I have an abstract baseclass with a collection of details IList that is automapped with fnh. After it has been populated with the correct values i would like to set some properties with reflection on the my class that inherits the abstract baseclass. I have tried to accomplish this in the constructor of my abstract baseclass but obviousl...

SQL Server Search Proper Names Full Text Index vs LIKE + SOUNDEX

I have a database of names of people that has (currently) 35 million rows. I need to know what is the best method for quickly searching these names. The current system (not designed by me), simply has the first and last name columns indexed and uses "LIKE" queries with the additional option of using SOUNDEX (though I'm not sure this is a...

many-to-one with multiple columns

I have a legacy data base and a relation one-to-one between two tables. The thing is that relation uses two columns, not one. Is there some way to say in nhibernate that when getting a referenced entity it used two columns in join statement, not one? I have a similar table structure TaskProgress ProgressId TaskId AssignmentId UserId ...