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

Is it posssible to batch different inserts/IDbCommands together with Nhibernate?

Example 1, the following insert results in 2 batches regardless of your configuration: INSERT INTO entitytable1 (someInt) VALUES (1) INSERT INTO entitytable2 (someInt) VALUES (3) -- Notice tables are different -- Results in…
Newbie
  • 7,031
  • 9
  • 60
  • 85
0
votes
1 answer

Fluent NHibernate mapping a joined sub class without the original class file

I have a library with a class called Recipient which has it's own fluent mapping setup within the library. Now in another project I have created a new class called SentEmail which inherits from Recipient, I want to be able to create a new mapping…
John_
  • 2,931
  • 3
  • 32
  • 49
0
votes
1 answer

using a View in a Named Query

I have a named Query that uses a view. I am unable to create a class mapping because this view does not have a Id column. I created a named query and set it to return it as a class, defining all the return values. However, I still receive a…
Thad
  • 1,518
  • 2
  • 21
  • 37
0
votes
1 answer

NHibernate error in mapping column

My hbm.xml file is as follows:
Suja Shyam
  • 971
  • 2
  • 27
  • 57
0
votes
1 answer

How to add a custom tuplizer for a Component programmatically?

Can anyone give me some direction as to how to add a custom tuplizer for a Component programmatically? To add it to a class is as simple as: new Configuration().ClassMappings .First() …
Newbie
  • 7,031
  • 9
  • 60
  • 85
0
votes
2 answers

NHibernate Mapping File Help

NHibernate noob here. Looking for advice on how to map the following common scenario: [Store] id pk Name [StockItem] id pk Name [StockItemStore] id pk StockItemId fk StoreId fk ParLevel I have created a domainmodel that allows various StockItems to…
Samuel Goldenbaum
  • 18,391
  • 17
  • 66
  • 104
0
votes
1 answer

Multiple hasmany same keycolumn - illegal access to loading collection

it works. pull the data, but gives this error: illegal access to loading collection public class Image : File { public virtual string ImagePath { get; set; } } public class Video : File { public virtual string…
0
votes
1 answer

Is there a tool that can be observed existing attributes a hbm file?

I have a project using NHibernate. The hbm files for mapping is set to manually. But i am not aware of other attributes of fields in hbm file. Is there a tool that can be observed existing attributes a hbm file?
Ehsan
  • 3,431
  • 8
  • 50
  • 70
0
votes
1 answer

FluentHibernate: mapping composite primary keys extended to many levels

I have three tables: BillHead, BillDet, BilDetDet with the following db diagram PK and FK's are defines as given below: Table Name Primary Key Foreign Key FK…
Nagesh
  • 1,288
  • 3
  • 22
  • 46
0
votes
1 answer

How Optimization in NHibernate query and best performance

I have a project by NHibernate implementation and using Lazy Loading. I have two class in this project : Person and PersonIdentity. Relation between Those two is aggregation, is mean a Person has a one PersonIdentity. Person mapping is :
Ehsan
  • 3,431
  • 8
  • 50
  • 70
0
votes
1 answer

Fluent Nhibernate composed entity, specify parent key

In this question I was answered hot to map a composed entity from the primary key of the table. So given: public UserMap() { WithTable("aspnet_Users"); Id(x => x.Id, "UserId") .GeneratedBy.Guid(); Map(x => x.Name, "UserName"); …
Ronnie
  • 4,959
  • 10
  • 51
  • 69
0
votes
1 answer

Concurrency implementation in NHibernate

I have a project by NHibernate implementation and using Lazy Loading. I have three class in this project : Person, Identity and Family. Is mean a Person has a one Identity and a list of Family. Mapping is :
Ehsan
  • 3,431
  • 8
  • 50
  • 70
0
votes
3 answers

At a loss, how to map two classes in Nhibernate

Please forgive the clumsy question (if you can figure out a better way to word the question feel free to edit away). I have two classes SupportTicketCategory and SupportTicket (respectively): public class SupportTicketCategory { public…
Webjedi
  • 4,677
  • 7
  • 42
  • 59
0
votes
2 answers

Upgraded NHibernate and FNH DLLs - now getting "No persister" exceptions

I'm trying to upgrade my FNH Automapping project to the latest versions of NHibernate and Fluent NHibernate (NH 3.2 and FNH 1.3), but now I get a "no persister" exception on a derived class (though the base class still seems to be persisted…
Tom Bushell
  • 5,865
  • 4
  • 45
  • 60
0
votes
1 answer

How to create AutoMap feature for FluentNHibernate based on attributes?

I want to use map mechanism, based on property attribute marking, like this: [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] public class DomainSignatureAttribute : Attribute { } public…
user809808
  • 779
  • 1
  • 10
  • 23
1 2 3
99
100