Questions tagged [nhibernate-mapping]

XML mappings for the .NET framework object-relational mapper (ORM) NHibernate as created with .hbm.xml files.

NHibernate mappings done in XML files indicate how classes map to database objects. Refer to the relevant NHibernate reference section for details on how to create such mappings.

2300 questions
0
votes
1 answer

NHibernate - Mixing subquery and an eager left join

Consider this database model: Product Payment Info ------- ------- -------- Id Id Id Name Value Year Date Description …
user315648
  • 1,945
  • 3
  • 22
  • 30
0
votes
2 answers

Mapping NHibernate Many-to-Many

I am trying to map a legacy database here and I'm running into a problem. In my schema I have a concept of Modules and a concept of Variables. Each Module consists of one or more Variables and each of these Variables has properties specific to that…
Jeffrey Cameron
  • 9,975
  • 10
  • 45
  • 77
0
votes
1 answer

nhibernate - criteria through intermediate table

I have a table Team and I have a table Location. Each team can have multiple locations and each location could have multiple teams, so it is a many to many relationship. When this scenario is created in the database, there will be 3 tables, Team,…
Chris
  • 174
  • 10
0
votes
1 answer

How to use an Interface as part of a CompositeID in fluent Nhibernate

I'm having trouble figuring out how to map an interface while using a composite key. What I'm trying to do is this: interface Ifoo { int someInt {get;} int id {get;} } class bar1: Ifoo { int someInt {get; protected internal set;} int id…
Zipper
  • 7,034
  • 8
  • 49
  • 66
0
votes
2 answers

Nhibernate, Need help to build entity class

I have 3 tables, they are very simple. User, Post, Favorite. User Table: Id: int Name: string -------------------------------- Post Table: Id: int Title: string …
qinking126
  • 11,385
  • 25
  • 74
  • 124
0
votes
1 answer

Embedded resource mapping files added - class not mapped

In my asp.net mvc application I'm using nhibernate 3.2 as ORM. I have catalogue structure like ..\Models\Persons with User.cs and OtherClass.cs in it and also ..\Mapping with files hibernate.xml,Persons.xml I added mapping files as embeeded…
Axxxon
  • 703
  • 2
  • 11
  • 27
0
votes
1 answer

Spring Exception on starting Application

I had taken reference from Vannilla for Spring Hibernate Integration Example. When I start Tomcat with the Application, following error occurs: 27 Dec, 2011 6:08:22 PM org.apache.catalina.core.ApplicationContext log SEVERE:…
Ankit
  • 425
  • 1
  • 5
  • 21
0
votes
1 answer

Hibernate/NHibernate mapping rules

I found a good article on Hibernate associations mapping (http://docs.jboss.org/hibernate/core/3.5/reference/en/html/associations.html). Could the same rules described in the article be applied to NHibernate mapping files? Thanks!
lexeme
  • 2,915
  • 10
  • 60
  • 125
0
votes
2 answers

NHibernate won't delete orphaned object

I have a few classes that look like this public class Token { public int Id { get; set; } public ITokenInstance Instance { get; set; } } public interface ITokenInstance { int Id { …
Gareth
  • 2,061
  • 2
  • 17
  • 22
0
votes
2 answers

NHibernate SessionFactory and mapping issues

After, many hours of reading outdated documentation on the Internet for managing session and configuration of NHibernate / Fluent Nhibernate I actually got a configuration that works without using XML, my poco's and map files work in the WebProject…
0
votes
1 answer

nhibernate and All-delete-orphan

i have a an entity class which has a bag of child entity class like so(copied relevant lines):
Menyh
  • 707
  • 1
  • 10
  • 30
0
votes
2 answers

NHibernate - Multiple table mapping?

I'm working on a project which handles Users and Projects: A user may be assigned to zero or X projects. A user has read or write rights on a project. In my database, I have a table named Users_Projects_Rights, which is used to associate a user…
Hussein Khalil
  • 1,585
  • 2
  • 25
  • 47
0
votes
1 answer

How do I create a table-per-class mapping with fluent nhibernate?

I'm trying to create a mapping similar to the following with fluent nhibernate:
0
votes
1 answer

Delete only the relationship between tables, not the data

I am using NHibernate for DB connection for the following classes: Class A { public int Id{get;set;} public List InnerElements{get;set;} } Class B { public int Id{get;set;} public string Description{get;set;} ...no reference to…
Tamas Ionut
  • 4,240
  • 5
  • 36
  • 59
0
votes
2 answers

Nhibernate: How create a on two classes for same class child?

I have a class/table named "Comment" And I need to create a bag of…