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: NHibernate: Mapping d'une table en entier, sans clef étrang
PostPosted: Wed Feb 14, 2007 7:59 am 
Newbie

Joined: Wed Feb 14, 2007 7:42 am
Posts: 3
Location: London, UK
Bonjour,

Je suis bloqué sur un problème, sans pouvoir trouver la solution sur le net ou dans ce forum:

J'ai une classe A, et je voudrais mapper chaque objet existant d'une classe B (donc la table B en entier) dans un IDictionnary sur la classe A.

Le problème est que l'utilisation de <map> requiert une clef étrangère <key> qui n'existe pas en l'occurence...

En plus clair:


La classe A:


Code:
public class A_Class
{
   IDictionnary<string, B_Class> MesBés;
}


La classe B:

Code:
public class B_Class
{
  string Nom;
}


Donc en gros je voudrais chaque B existant (donc chaque records de la table B) mappé dans un IDictionnary de la classe A:


Code:
      <map name="MesBés" table="B_Table">
        <key column="CETTE COLONNE N'EXISTE PAS"></key>
        <index column="Nom" type="string"></index>
        <one-to-many class="B_Class"/>
      </map>


Une idée de comment je pourrais faire ?

Merci beaucoup !!!


Antoine.


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.