Bonjour,
Je fais face au problème suivant : NHibernate prévoit-il un moyen d'effectuer un mappage de deux classes associées, dont les tables Oracle correspondantes sont situées sur deux instances différentes.
instances distinctes ==> connexions distinctes
Voici un mappage test.
Soient deux instances Oracle 10g :
- 'SCHEMA1' comportant la table USER(user_id, user_ast_id) ;
- 'SCHEMA2' comportant la table ASTREINTE(ast_id).
Soient deux classes CUser(Id, Astreinte), CAstreinte(Id)
Ce mappage ne produit rien de bon. Quelqu'un a-t-il déjà fait face à la problématique ? Merci.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" schema="SCHEMA1"> <class name="CUser" table="USER"> <id name="Id" type="string"> <column name="USER_ID" sql-type="nvarchar2" length="50" not-null="true" unique="true" /> <generator class="assigned"/> </id> <many-to-one name="Astreinte" class="CAstreinte" column="USER_AST_ID" lazy="false" cascade="save-update" /> </class> </hibernate-mapping> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" schema="SCHEMA2"> <class name="CAstreinte" table="ASTREINTE"> <id name="Id" type="string"> <column name="AST_ID" sql-type="nvarchar2" length="50" not-null="true" unique="true" /> <generator class="assigned"/> </id> </class> </hibernate-mapping>
Partager