Questions tagged [composite-id]

59 questions
2
votes
1 answer

Fluent NHibernate Mapping - Composite Key

I'm trying to map the following tables/entities in FNH and seem to be getting nowhere fast! **Tables** Contacts ID (PK - int - generated) ... PhoneTypes ID (PK - varchar - assigned) (e.g. MOBILE, FAX) ContactPhones ContactRefId …
2
votes
0 answers

NHibernate, could not load an entity when column exists in the database

This is probably a simple question to answer but I just can't figure it out. I have a "Company" class with a many-to-one to "Address" which has a many to one to a composite id in "City". When I load a "Company" it loads the "Address", but if I call…
Eitan
  • 1,434
  • 6
  • 21
  • 53
2
votes
1 answer

Hibernate XML Subclassing with composite-key

I want to extend a class with hibernates joined-subclass. The problem is, that the extended class had a composite-key and the normal class only has a normal primary key (see image). Is there a option to realize this class-structure? Currently the…
501 - not implemented
  • 2,638
  • 4
  • 39
  • 74
2
votes
3 answers

Why can't I reference child entities with part of the parent entities composite key

I am trying to reference some child entities with part of the parents composite key not all of it, why cant I? This happens when I use the following mapping instead of that which is commented. I get the following error Foreign key in table …
Anthony Main
  • 6,039
  • 12
  • 64
  • 89
2
votes
1 answer

Mapping Foreign Key as Primary Key Fluent NHibernate

I have the following table scenario: User - Id (PK) - Username Advert - Id (PK) - Title AdvertPhoto - Advert (PK) (Also a FK for Advert table) - Image Bid - Advert (PK) (Also a FK for Advert table) - User…
Kiwanax
  • 1,265
  • 1
  • 22
  • 41
2
votes
0 answers

NHibernate - composite-id - 3

I have a class in Nhibernate hbm file and for this I'm using a composite id field, in the following way :
Catalin
  • 21
  • 1
2
votes
1 answer

Fluent NHibernate mapping a composite ID from inherited composite IDs

Let's say I have an existing database with the following 3 tables: Table1: (PK)T1ID1 (PK)T1ID2 Table2: (PK)T2ID1 Table3: (FK)T1ID1 (FK)T1ID2 (FK)T2ID1 (Where the 3 keys come from the tables above) My question is: How do I map Table3 with Fluent…
2
votes
2 answers

Is navigation through composite-id's key-many-to-one possible?

Is it possible to navigate through the key-many-to-one associations of a composite-id in Nhibernate? I have a few (legacy) tables that I mapped with the following settings:
Matthias Schippling
  • 2,923
  • 1
  • 18
  • 29
2
votes
2 answers

FluentMapping ComposedId with AutoInc

I am creating a transfer data tool for the company application, to move data from the old version to the new, and back. Since now we are using NHibernate and FluentMapping, I'll have to map all old tables, and there is a problem with one table with…
1
vote
1 answer

Fluent Nhibernate 3 Mapping Composite Field (Custom Type)

HI all, my scenario public class Permission { public virtual Function Function { get; set; } public virtual Profile Profile { get; set; } } public class MapPermission : ClassMap { public MapPermission() { …
user756037
  • 285
  • 1
  • 8
  • 20
1
vote
0 answers

Fluent NHibernate HasManyToMany() IDictionary<> Composite ID problem

I'm using Fluent NHibernate 1.1.1.694 which uses a slightly different syntax than FNH1.0, especially when it comes to dictionary mapping. In my model, I have Employees, Addresses and AddressTypes (postal, physical, etc). public class Employee { …
Francois Botha
  • 4,520
  • 1
  • 34
  • 46
1
vote
1 answer

Fluent NHibernate does an update after an insert on a Composite Key

I am using Fluent NHibernate to map a composite key. I need the child entity to receive the newly inserted parent key when the parent is created. This works but NHibernate is doing an insert on the child and thereafter doing an update on one of the…
1
vote
1 answer

nhibernate - problem with merging collections

I have parent/child relationship, and child have composite id Parent
Dmitry
  • 1,220
  • 2
  • 11
  • 18
1
vote
2 answers

Is it possible to have a composite id that can be edited in NHibernate?

I have a situation where I have tables that have many columns used as a composite primary key, worse off business logic requires these to be mutable. I am using nhibernate and have no problems mapping for loadig/saving these. However I need to be…
Dovix
  • 65
  • 6
1
vote
0 answers

Hibernate Criteria with composite-id - could not resolve property

I'm using Hibernate 4.3.2.Final and in the mapping.xml, I have a composite id like this:
pOluX
  • 21
  • 3