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

collection of value object mapping error

I'm trying To map object field in fluent-Nhibernate and C#,the model contain an entity which has a reference field to a ValueObject, this is the entity class public class QueryLeaf : Entity { public QueryLeaf() { FilterDescriptors =…
0
votes
1 answer

Fluent NHibernate mapping using a condition

I have a class with a boolean property, like this: public bool HasPermission { get; set; } but in our database, in this column we have information in varchar, and we have values like: "yes","y","no","n","0","1" How can I map this values to a bool…
abeppler
  • 13
  • 4
0
votes
2 answers

Search in Fluent-NHibernate using session.QueryOver<> return empty

Hey everyone I am new to ORM, Im using Fluent NHibernate in my CRUD seems to have a problem in my search, it will return an empty or null value and also I can insert data, but when i insert another record its seems updating bcoz it replace my…
0
votes
1 answer

Join Tables using Fluent Nhibernate

I have following table structure Author[AuthorId,AuthorName]; Book [BookId, BookName, AuthorId]; And already created following classes for F.N mappings public class Author { public virtual int AuthorId { get; set; } public virtual…
0
votes
1 answer

How to join three tables using FluentNhibernate

I'm using FluentNhibernate for my C# application i would like to know how to join three tables which not having Foreign keys defined. Lets assume i have following table structure, Student [StudentID, Name1, Name2, ClassID ] Class [ClassID, Name,…
Praveen
  • 41
  • 5
0
votes
1 answer

How to map a string collection from another table in Fluent NHibernate?

I have an entity: public class Foo { public virtual int Id; public virtual IEnumerable Bars; } And its mapping: public class FooMapping : ClassMap { public FooMapping() { Table("foo_table_in_database"); …
0
votes
1 answer

Fluent NHibernate One-To-ZeroOrOne Mapping

In my business model I have "User Role" entity and one (or zero) "RoleFunctionality" entity assigned to it: "UserRole" ( id integer NOT NULL, name character varying(255), CONSTRAINT "UserRole_pkey" PRIMARY KEY (id) ) "RoleFunctionality" ( …
0
votes
1 answer

Moving an NHibernate-heavy application from single-tenancy to multi-tenancy with multiple schemas

I currently have a single-tenant application that uses fluent-nhibernate mappings to map C# objects to tables in my MySQL database. As part of an effort to bring multi-tenancy to my application, I am considering having a single schema for each…
0
votes
2 answers

Bi-directional relationship in nhibernate 4.0

I have a code that was working perfectly on NHibernate 3.1, but when it is not working on NHibernate 4.0 So, this is the class relations public class Employee : BaseEntity { ... public Department Dept { get; set; } } public class Department…
0
votes
1 answer

Fluent NHibernate HASMANY mapping without references

I am a beginner at using Fluent NHibernate. I am developing a C# application that has to interact with an existing database.Let say I have 2 tables: Items and ItemsList. Items: ID INT ItemName VARCHAR(100) ItemsList: ID INT ChildItemID…
0
votes
1 answer

How do I setup Id of entity with a ConventionBuilder in Fluent NHibernate

I have following fluent configuration var sessionFactory = Fluently.Configure() .Database(configuration) .Mappings(arg => { var…
user57508
0
votes
1 answer

Fluent NHibernate complicated (?) relations

I'm having troubles creating the relations using Fluent NHibernate. Generally, i have two tables, resource & items: please notice that PK in the resources table is both id AND locale. it means that, one item can actually have few resources (same id…
0
votes
1 answer

I have a proglem with nhibernate fluent with C# + MVC. It doesn't make id unique

I have a proglem with nhibernate fluent with C# + MVC. It doesn't make id unique. I run my application. Add post. Its id is 1. I stopped my app. Then I run it again and if i create new record it is generated id 1 for another post and write it over…
0
votes
2 answers

Fluent nhibernate m-to-m mapping with external table

I have two tables in Oracle Entity ---------- **EntityId** NUMBER(9), **EntityName** VARCHAR2 EntityLinks -------------- **EntityLinkId** NUMBER(9),**ParentEntityId** NUMBER(9), **ChildEntityId** NUMBER(9) Table EntityLinks will store ManyToMany…
0
votes
0 answers

Fluent NHibernate - One to many mapping without primary keys in database

In my database I have table A with primary key IdA and a table B without primary key and with columns IdA (foreign key to A) and IdB (simple column, not a primary key). In code Class A must have a collection of B instances. Can you please tell me…