tags:

views:

742

answers:

1

We have some mapping already done in hbm.xml and I'd rather not have to map these programatically can you mix them in same sessionfactory until we have the time to repay the debt?

+4  A: 

Yep.

It is absolutely possible to mix them. I'm doing it on my current project.

My SessionFactory construction looks something like this:

        _configuration = new Configuration();
        _configuration.SetProperties(properties);

        // hbm files
        _configuration.AddAssembly(typeof(ISurveyTask).Assembly);

...

        var persistenceModel = new PersistenceModel(...)

        // fluent mappings
        persistenceModel.addMappingsFromAssembly(typeof(ISurveyTask).Assembly);
        persistenceModel.Configure(_configuration);

Enjoy :-)

RasmusKL