These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapping a collection of collections
PostPosted: Sat Dec 01, 2007 8:19 am 
Newbie

Joined: Sun Aug 12, 2007 7:43 pm
Posts: 3
Location: Göteborg, Sweden
I've got the following table:

CREATE TABLE [dbo].[Bok_Objekt](
[id] [int] IDENTITY(1,1) NOT NULL,
[KlientId] [int] NOT NULL,
[Typ] [tinyint] NOT NULL,
[Kod] [nvarchar](25) COLLATE Finnish_Swedish_CI_AS NOT NULL,
[Namn] [nvarchar](255) COLLATE Finnish_Swedish_CI_AS NOT NULL,
[Arkiverad] [tinyint] NOT NULL,
CONSTRAINT [PK_Bok_Objekt] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]


which I would like to map to a two-level Dictionary like this:

Dictionary<Int32, Dictionary<String, BokObjekt>> mappings = new Dictionary<Int32, Dictionary<string, BokObjekt>>();

The first level dictionary splits the table by the "Typ"-column. The second level dictionary represents all values inside the table with a specific value in the "Kod"-column.

Basically this would lead to a mapping with two map-tags, is this possible at all?

I would really like to avoid having to create subclasses with discriminator values for the Typ-column, as this column can contain upto 100 different values.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.