Questions tagged [nhibernate-mapping-by-code]

Mapping-by-code is NHibernate's own API by which mappings can be configured by code. Introduced in NHibernate version 3.2.

Mapping-by-code is NHibernate's own API by which mappings can be configured by code. It was introduced in NHibernate version 3.2. In a strict sense this applies to the namespace NHibernate.Mapping.ByCode. It may als pertain to NHibernate.Cfg.Loquacious, but not FluentNhibernate, which has its own tag.

158 questions
4
votes
2 answers

NHibernate wrongly comparing to null when deleting a component

I currently have an issue when updating a component collection on an entity. It was originally mapped as a bag but that was causing all entries to be deleted and reinserted each time. Changing it to a set has fixed that problem but introduced a new…
Barry Woods
  • 205
  • 3
  • 10
4
votes
1 answer

NHibernate mapping-by-code in .NET 4.6 throws "Cannot extend unmapped class"

I have project running for several months in same NH configuration that I opened today on a clean installation of Windows (VS 2015 RC is installed, also .NET 4.6 RC is installed, but project is targeting .NET 4.5) In building of NH session factory…
4
votes
1 answer

NHibernate Mapping By Code Cascade All-Delete-Orphans

How to set cascade to all-delete-orphans with mapping by code in NHibernate? [Flags] public enum Cascade { None = 0, Persist = 2, Refresh = 4, Merge = 8, Remove = 16, Detach = 32, ReAttach = 64, DeleteOrphans = 128, …
samvdst
  • 618
  • 7
  • 22
4
votes
1 answer

Why is FetchKind not working in NHibernate using Mapping.ByCode

I believe this issue is caused by the ignoring of the FetchKind property. I have an employee table: Employee { ID Name PositionCode } and a position table: Position { Code Description } I've joined these tables using…
4
votes
1 answer

NHibernate 3.3.1 mapping by code many-to-many relationship with property-ref

I have an pretty big database and I have to map two entities using NHibernate 3.3.1 byCode mapping (please take in account that I'm not using FluentNHibernate, but built-in mappings) Entities are in a many to many relationship through and unique…
isuruceanu
  • 1,157
  • 5
  • 23
4
votes
3 answers

Mapping inheritance in NHibernate 3.3

I have the inheritance described below : public abstract class BaseEntity {....} public abstract class ModelEntity : BaseEntity{....} public abstract class AuditableEntity : ModelEntity,IAuditable{....} public class ApplicationUser :…
Pierros V
  • 41
  • 3
4
votes
1 answer

nhibernate HbmMapping to Xml

I am using NHibernate mapping-by-code to map the classes. Sometimes, in order to debug my NHibernate configuration, I would require to check exactly what were the settings passed over to NHibernate, and it is quite difficult do debug the…
Karl Cassar
  • 6,043
  • 10
  • 47
  • 84
3
votes
1 answer

Multi-level inheritance using NHibernate's Loquacious Mapping By Code

I am using the NHibernate convention-based-mapping and I'm trying to work out how to map a multi-level inheritence structure If I have the following class structure class ClassA class ClassB : ClassA class ClassC : ClassB and I want all three…
3
votes
1 answer

One to one mapping in NHibernate 3.2 mapping by code

I'm trying to learn NHibernate 3.2 built-in mapping by code api (NOT Fluent NHibernate). Can you help me to map a one-to-one(or zero) relationship between these entities please? NOTE: I googled the question, also I search the SOF, all examples are…
amiry jd
  • 27,021
  • 30
  • 116
  • 215
3
votes
1 answer

Nhibernate Loquacious Mapping By Code (Not-Found=Ignore)

I am trying to create a ManyToOne map over a legacy database, as such need it to ignore any orphaned records. The original xml way of describing it was: But I am unable to describe it using NHibernate 3.2 Mapping…
3
votes
1 answer

NHibernate 3.2 By Code (Conformist) ClassMapping For a Dictionary Property

Assume I have a class "SomeClass" that has a lookup dictionary: DataDictionary; I currently have a mapping in SomeClass.hbm.xml like this:
keithwill
  • 1,964
  • 1
  • 17
  • 26
3
votes
1 answer

NHibernate multi column ManyToOne mapping with Mapping By-Code

I am trying to convert my FluentNHibernate mappings to NHibernate Mapping By-code using NHibernate 3.3.3. The goal is to upgrade to NHibernate 3.3.3 and to cut down on the number of assemblies being distributed. However when I compile and run I get…
Wietze
  • 313
  • 5
  • 8
3
votes
1 answer

Set scale and precision of decimal identifier

We are working on a distributed, sequential ID generator that creates a 96-bit numeric ID. The datatype we work in the application for this value is decimal. On the database side, the column's datatype would be decimal(28,0). The problem is that…
moribvndvs
  • 42,191
  • 11
  • 135
  • 149
3
votes
1 answer

NHibernate: cannot resolve inherited id property

I have the entity defined below: public class Foo : Entity { public class FooId { public virtual String Bar { get; protected internal set; } public virtual Int32 Buzz { get; protected internal set; } } //…
NicolaBaldi
  • 133
  • 1
  • 2
  • 6
3
votes
2 answers

Simple get using NHibernate (using mapping-by-code) is extremely slow

So i've run out of ideas as to why this is so slow. Maybe you can help. So I am trying to do a simple get on record from an oracle db using nHibernate mapping by code. I'm using nHibernate verison 3.3.1.4 from nuget. Here is the mapping code: public…
Prabu
  • 4,097
  • 5
  • 45
  • 66
1
2
3
10 11