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.  [ 3 posts ] 
Author Message
 Post subject: Appel de procédure stockée sous Oracle
PostPosted: Wed Jan 16, 2008 5:46 am 
Newbie

Joined: Fri Jan 04, 2008 4:23 am
Posts: 7
Bonjour,

J'essaie d'appeler une simple procédure stockée sous Oracle 9 depuis Hibernate mais je voudrais avoir quelques pistes.

Ma procédure stockée est toute simple dans un premier temps : un UPDATE est fait sans passer aucun paramètre.

Mon fichier de configuration est correct : hibernate.cfg.xml.

J'ai créé un fichier de mapping pour la procédure stockée :

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 9 mai 2007 13:50:38 by Hibernate Tools 3.2.0.b9 -->
<hibernate-mapping>
    <class name="com.test.bo.TestProc">
        <sql-update>
            Call PS_UPDATE_TEST
        </sql-update>
    </class>
</hibernate-mapping>


Je voudrais maintenant savoir comment j'appelle la procédure depuis le code JAVA ?

Merci d'avance pour toute info.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 16, 2008 6:39 am 
Newbie

Joined: Fri Jan 04, 2008 4:23 am
Posts: 7
Bon lorsque je veux tester ma procédure j'ai le message suivant :

org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/test/bo/TestProc.hbm.xml


Etant donné que je ne passe aucun paramètre à cette procédure, la classe référencée dans
Code:
<class name="com.test.bo.TestProc">
est la suivante :

Code:
package com.test.bo;


public class TestProc {
   
    /** Creates a new instance of TestProc */
    public TestProc() {
    }
   
}


Ca vient peut-être de là ?

Merci d'avance.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 17, 2008 5:40 am 
Newbie

Joined: Wed Jan 09, 2008 6:26 am
Posts: 19
A priori soit ton fichier de mapping "TestProc.hbm.xml" ne s'appelle pas réellement comme ca, soit il n'est pas contenu dans le package "com.test.bo". Donc vérifie le nom/répertoire de ton fichier de mapping par rapport à ce que tu as déclaré...

_________________
Don't forget to rate answers! ;-)


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

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.