I have a base class that contains a property called IsDirty. This is used for the domain model and is not a column in the database table.
When using automapping, fluent nhibernate tries to add this column to the table. A way to fix this is to put .ForTypesThatDeriveFrom(p => p.IgnoreProperty(x => x.IsDirty)) in the automapping setup.
T...
I have the following class
class MCustomer : DomanEntity
{
public MCustomer( )
{
}
public virtual iCustomerEntity CustomerDetials {get;set;}
public virtual SolicitationPreferences SolicitationPreferences
{
get;
set;
}
}
public interface iCustomerEntity
{
Contact ...
I love Fluent NHibernate for building my DBs and so far haven't found a restriction that has halted me in my tracks.
However on my current project I expect to release to production very early in the product lifecycle and hence expect there to be many small changes in the db schema as we progress.
I'd like to track these DDL amd DML cha...
Nothing happens when updating an entity using the SaveOrUpdate method with FluentNHibernate. Flush does work but I want to use SaveOrUpdate due to existing repository infrastructure. What could be the problem?
Configuration:
sessionFactory = Fluently.Configure()
.Database(MsSqlConfiguration
.MsSql2005
.Connectio...
Hi All,
Im experiencing some frustration trying to upgrade the nhibernate libraries that Fluent NHibernate uses.
Im also using Nhibernate.Linq and am wanting to use NHibernate.Validator, specifically the ValidationDef class.
Now Nhibernate.Validator is up to using Nhibernate 2.1.0.1003, and when i try to build FluentNhibernate against...
Hi there.
I'm new to NHibernate and am having difficulty with a simple but stuborn error.
I have a table in my DB (MSSQL2008) where the composite key is made up of 2 date columns.
These would represent a time period StartDate and EndDate that is unique for the purposes of my solution.
The table definition is as such:
CREATE TABLE [d...
I am new to fluent nhibernate and nhibernate. I want to write a fluent nhibernate autopersistence convention to handle creating the many to many mappings for my entities.
This is what I have right now:
using System;
using FluentNHibernate.Conventions;
using FluentNHibernate.Mapping;
namespace Namespace
{
public class HasManyToMan...
Hello Guys...
I updated the Npgsql driver to the last version (2.0.5) and got error in my NHibernate App...
Mappings:
School mapping :
...
References(x => x.City);
...
And City Mapping:
Id(x => x.ID).GeneratedBy.Assigned();
Map(x => x.Name);
References(x => x.Microrregion);
Now, when I tried to load a School, I got a NHibernate....
I have a local website which I run through Visual Studio 2008's internal development web server (through the run / compile button).
I have an external library which is referenced on a page of that website and resides inside the web site's "bin" folder.
I've recently changed a class' property name inside that library (renaming it, from ...
Is there a way to set the column prefix for a component in fluent. For example:
public class SomeClassMap : ClassMap < SomeClass >
{
public SomeClassMap()
{
CreateMap();
}
private void CreateMap()
{
WithTable("Class");
Id(x => x.Id).GeneratedBy.Guid();
Map(x => x.Name).WithLeng...
This question might be a duplicate of this one:
http://stackoverflow.com/questions/217761/nhibernate-disable-automatic-lazy-loading-of-child-records-for-one-to-many-rela
I'd like to know if there is any way to tell nhibernate to do not load a child collections (best if it's with fluent Nhibernate) unless i do it manually with a query ...
I am trying to optimize a tree-structure for my category-model. The Category-model has a Parent-property and a Children-collection.
The way i normally do this, is to load all categories (sounds bad, but max 100 nodes). The tree is then manually assembled, by indexing all categories by id, and then by looking up the parent by the catego...
It seems I can't find the correct syntax to define a nhibernate filter using fluent Nhibernate.
I'm trying to follow this ayende's blogpost:
http://ayende.com/Blog/archive/2006/12/26/LocalizingNHibernateContextualParameters.aspx
I defined the formula on my property with .FormulaIs() method but can't find on google how to translate thi...
I'm trying to use S#arp architecture... which includes Fluent NHibernate I'm newbie with (and with NHibernate too, frankly speaking). Auto mapping is used.
So I have this:
public class UserAction : Entity
{
public UserAction() { }
[DomainSignature]
[NotNull, NotEmpty]
public virtual string Name { get; set; }
[NotNul...
In particular, I'd like to set current_session_context_class. I know how to do it in hibernate.cfg.xml, but is it possible at all with pure fluent configuration?
...
Hi all
I am getting the following runtime error in my ASP.Net MVC application:
NHibernate.MappingException: No persister for: MyProject.Model.MyDomainObject
I am referencing the burrow and fluent binaries in my application and am reconfiguring burrow in Global.asax on Application_Start as follows:
var bf = new BurrowFramework();
IFr...
Hi, I have a Customer table and an AddressTable. My table looks like this :
Table Customer
{
ID,
Name
}
Table Address
{
ID,
CustomerID,
AddressType,
Address
}
(AddressType is 1 for HomeAddress and 2 for WorkAddress)
In my Customer class I have 2 properties for Address type
class Customer
{
Address HomeAdress;
Address WorkAddress;...
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.
Ex...
Domain:
class Category
string Name
class Product
IDictionary<string, Product> Parents
Tables:
Categories (ID, Name)
Products (ID)
ProductParents (ID, ParentID, ChildID, CategoryID)
The questions: I need to get list of parent products. Is it possible to map parent products to dictionary so that I can do:
produ...
Hi
I've got 2 entities and splitter table for many-to-many relationship:
CREATE TABLE T_CUSTOMER
(
CUSTOMER_ID NUMBER NOT NULL
)
CREATE TABLE T_CC
(
CC_ID NUMBER NOT NULL
)
CREATE TABLE T_CUSTOMER_CC_SPLITTER
(
CCCU_CUSTOMER_ID NUMBER NOT NULL,
CCCU_CC_ID NUMBER NOT NULL,
STATUS NUMBER NOT NULL
)
I'...