Questions tagged [fluent-nhibernate-mapping]

Fluent, XML-less, compile safe, automated, convention-based mappings for NHibernate

Fluent NHibernate offers an alternative to NHibernate's standard XML mapping files. Rather than writing XML documents (.hbm.xml files), Fluent NHibernate lets you write mappings in strongly typed C# code. This allows for easy refactoring, improved readability and more concise code.

Resources

626 questions
0
votes
1 answer

FluentNHibernate - How to map KeyProperty with db generated value?

I have this mapping: public sealed class AcessoMap : ClassMap { public AcessoMap() { CompositeId() .KeyReference(x => x.Associado) .KeyProperty(x => x.DataHora, k =>…
Zote
  • 5,343
  • 5
  • 41
  • 43
0
votes
1 answer

Fluent nHibernate Mapping with Ternary Mapping Table

Have a legacy database with mapping table structures like the following. I am trying to figure out how to fluently map this type of relationship. There are multiple parent tables that use a mapping table to store notes. The parent tables look like…
DRK
  • 1
0
votes
1 answer

how to keep many to many relationships in sync with nhibernate?

I am creating data model for two objects Employee and Department. Employee has a list of departments and Department has a list of employees. class Employee{ private IList _departments; public Employee() { …
8GB
  • 79
  • 3
  • 13
-1
votes
1 answer

Can I use NHibernate.Cfg.Configuration in Fluent-NHibernate when building a session factory?

I want to use the NHibernate configuration for FluentNhibernate when building a session. This how I am constructing my factory session: lock (_factorylock) { if (_factory == null) { …
-1
votes
1 answer

NHibernate PropertyRef fluent mapping

Is there any way to make query over joins on different nullable foreign key? Release notes: https://github.com/nhibernate/nhibernate-core/blob/5.2.4/releasenotes.txt#L103 A collection mapped with a property-ref will no more support being…
-1
votes
2 answers

Create Object by Constructor in Object Mapping

I have following Address object: public class AddressObject { public string Postcode { get; set; } public string City { get; set; } public string Street { get; set; } public AddressObject(string PostCodeString, string CityName,…
Snickbrack
  • 1,253
  • 4
  • 21
  • 56
-1
votes
2 answers

NHibernate + fluent mapping + NLog = No mapped documents found in assembly

I've successfully used the CommonLogging layer in NHibernate to log its internal messages using NLog for previous projects which were using hbm.xml files. I'm now switching to fluent mapping, and the NHibernate logs now only contain one line: [Log…
Bogdan Stăncescu
  • 5,320
  • 3
  • 24
  • 25
-1
votes
1 answer

What do inverse and readonly attributes do in NHibernate napping do?

While I am working a project I have seen this line of NHibernate mapping HasMany(entity => entity.Tasks).KeyColumn("APPLICATION_ID").Cascade.AllDeleteOrphan().ReadOnly().Inverse(); it is the first time for me I see some one using the inverse and…
Mo Haidar
  • 3,748
  • 6
  • 37
  • 76
-1
votes
1 answer

FluentNHibernate: An invalid or incomplete configuration was used while creating a SessionFactory

So, I have a problem with FluentNHibernate. I've mapped all the properties, I've linked my tables and I get an error: An invalid or incomplete configuration was used creating a SessionFactory. Check PotentialReasons collection, and InnerException…
-1
votes
1 answer

Having different automapping "configurations"

I want to have two different mapping configurations. I need to somehow pass arguments to conventions so they can behave differently. Beside using lock and static fields how can I do this?
-1
votes
1 answer

Using Fluen-nHibernate spikes up the CPU

I'm using fluent nHibernate as ORM and mapping the classes using auto mapping in fluenthibernate.The classes would be mapped only once as i'm calling them in global.asax .For some reason the CPU is spiking up to high 90% sometimes .I profiled the…
1 2 3
41
42