Bonjour à tous,
j'ai récupéré le très bon tutoriel de Serge Tahé sur les Tutorial (BasesWebMVC) et je bloque sur l'utilisation de hibatis pour le traitement des données en base. la config a l'air correcte, l'objet lié à la source de données AdminUser contient bien les getter/setter nécessaires, mais je ne parviens pas à trouver l'erreur.
l'exception générée est :
org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in WEB-INF/loginUser.xml.
--- The error occurred while applying a result map.
--- Check the AdminUser.map.
--- The error occured while instantiating the result object
--- Cause: java.lang.RuntimeException: JavaBeansDataExchange could not instantiate result class. Cause: java.lang.InstantiationException: com.project.entities.AdminUser; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in WEB-INF/loginUser.xml.
--- The error occurred while applying a result map.
--- Check the AdminUser.map.
--- The error occured while instantiating the result object
--- Cause: java.lang.RuntimeException: JavaBeansDataExchange could not instantiate result class. Cause: java.lang.InstantiationException: com.project.entities.AdminUser
le fichier de config contenant le resultMap est :
<sqlMap>
<!--mappingtable[USERS]-objet[AdminUser]-->
<resultMap id="AdminUser.map" class="com.project.entities.AdminUser">
<result property="id" column="ID" />
<result property="login" column="LOGIN" />
<result property="password" column="PASSWORD"/>
</resultMap>
<select id="AdminUser.getOneFromLogin" resultMap="AdminUser.map">
select ID, LOGIN, PASSWORD FROM USERS WHERE LOGIN=#value#</select>
...
...
...
ma couche DAO appelle bien la méthode par l'appel suivant:
AdminUser DBuser = (AdminUser) getSqlMapClientTemplate().queryForObject("AdminUser.getOneFromLogin",new String(user.getLogin()));
la table mise en correspondance contient bien les 3 Champs (ID, LOGIN, PASSWORD) et la table comprend bien l'enregistrement recherché.
Pouvez vous m'éclairer ? de quoi a besoin hibatis (ou springframework) comme référence vers un Objet pour l'instancier ?
Merci de votre aide.
Partager