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: Comment faire une jointure sur des champs de type différent
PostPosted: Tue Oct 31, 2006 7:32 am 
Newbie

Joined: Tue Oct 31, 2006 7:23 am
Posts: 1
Bonjour,

J'ai dans mon application deux table :
UTILISATEUR : dont la clé primaire est de type numérique.
ROLE : dont un champs est une clé étrangère vers la table utilisateur. mais ce champs n'est pas de type numérique, il est de type CHAR(n).

J'ai bien essayé d'utiliser un Type personnalisé (étendre UserType) qui me permet de récupérer un numérique à partir d'une chaine de caractère, mais cela ne suffit pas.
Au niveau du sql généré par hibernate, il y a toujours une incompatibilité de types lors d'un inner join :
par exemple :
UTILISATEUR inner JOIN ROLE on id = userid
car id et userid sont de types différents.

Est il possible de régler ou contourner ce problème avec hibernate ?


Merci d'avance.


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.