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
2 answers

Fluent Nhibernate Mapping with Column

Hi i am stuck with one problem while dealing with fluent nhibernate. My user entity is below public class UserEntity { public virtual int Userid { get; set; } public virtual CompanyEntity CompanyId { get; set; } …
vishal
  • 233
  • 4
  • 7
0
votes
2 answers

FluentNHibernate mapping without foreign key

i have this 2 class public class Product { public virtual Guid Id {get; set;} public virtual string Name {get; set;} public virtual Description Description {get; set;} } public class Description { public virtual Guid Id {get; set;} …
Dion Dirza
  • 2,575
  • 2
  • 17
  • 21
0
votes
1 answer

nhibernate mapping generator integrated to build

I have searched for automatic mapping generator for nhibernate. So far I have tried following NHibernate Mapping Generator Devart Entity Developer Codesmith generator From those Nhibernate Mapping Generator is the only one that supports NH style…
0
votes
1 answer

Generating framework with NHibernate for Complex reports

I'm developing a application with wpf, Fluent NHibernate and MySQL,we need to generate complex reports. Can anyone help me out to find the best framework to implement for report generation at Database level. I need help, how should my report…
0
votes
1 answer

Storing an object[] as column in Fluent NHibernate

I have the following (partial) model: class LogMessage{ string Format; object[] args; } I want to store args[] as a single column in the table, taking advance of the fact that format arguments are generally serializable or can be converted…
0
votes
3 answers

Fluent NHibernate HasMany mapping inserts null in foreign key

I have 2 entities: public class Parent { public virtual string Number { get; set; } public virtual IList Children { get; set; } public Parent() { Phones = new List(); } } public class Child { public…
Roar
  • 2,117
  • 4
  • 24
  • 39
0
votes
1 answer

How to map an entity to entitycollection dictionary in fluent nhibernate

I have this classes (after removing redundant information from them): public class Category : BaseEntity { public virtual Category ContainingCategory { get; set; } public virtual IList Properties { get; set; } } public…
0
votes
1 answer

Assign a part of a composite foreign key at runtime

I have a class that references another class with a composite Id: SingleIdClassMap(){ Id(x=>x.Id); References(x=>CompositeIdClass); } CompositeIdClass(){ CompositeId().KeyReference(x => x.SingleIdClass).KeyReference(x =>…
Dani
  • 2,602
  • 2
  • 23
  • 27
0
votes
1 answer

Fluent NHibernate mapping to return description from lookup table

We have the following database structure: UserTeam table Id (PK, int not null) UserId (FK, int, not null) TeamId (FK, int, not null) RoleId (FK, int, not null) libRole table Id (PK, int not null) Description (varchar(255), not null) And we have an…
0
votes
2 answers

Fluent nHibernate Unit Test HasOne mapping

I have situation where I DO require one-to-one relationship thus the usage of HasOne. Yes I do want to have separate table for Patrons and Members. Following are my classes and their corresponding mapping classes. public class Member { public…
0
votes
1 answer

NHibernate - Has Many - Has One - ICriteria

I have the following tables: Table Material Id Table Zone Id Table MaterialZone Id Material_Id Zone_Id Price Edit What I need is to have the MaterialZone (whit the current Zone) in the Material object, I dont know if I can solve it by mapping or…
leomcpugo
  • 35
  • 8
0
votes
0 answers

FNH Mappings with DB2 GeneratedBy Identity

I am trying to map a table with an identity key field. When I try to save I get the error SQL0803 Duplicate key value specified INSERT INTO libpjk/Audit (AuditId, AuditDate, UserId, Keys, ValBefore, ValAfter, FieldId) VALUES (default, ?, ?, ?, ?, ?,…
D. Kermott
  • 1,613
  • 17
  • 24
0
votes
2 answers

nHibernate - Populate a mapped function with namedQuery

I'm using Fluent nHibernate for my data layer, and I have a class that is mostly populated through nHibernate/LINQ but in a few advanced usages, needs to be populated by a stored procedure. The problem I have is the class mapping includes a…
Dunc
  • 31
  • 6
0
votes
1 answer

Different sequences for subclasses with Fluent NHibernate

I am using Fluent NHibernate and table per concrete class for inheritance mappings. There is an abstract base class and two other subclasses. My base class has Id column. Created tables are ok. All tables has its own Id column. But sequence is only…
besc
  • 481
  • 3
  • 8
0
votes
1 answer

Parent-Child mapping with Fluent NHibernate does not insert children

I'm trying to map a very basic parent-child relation with Fluent NHibernate. However, when analyzing the SQL, only the parent-INSERT statement is created. The situation is a simple class with a list of other classes. No relation back to the parent…
Ronald
  • 1,990
  • 6
  • 24
  • 39