यह हो सकता है कि आपकी mapper.xml फ़ाइल usi है गलत नामस्थान (शायद एक कॉपी पेस्ट त्रुटि के कारण)।
MyEntityMapper.java
package my.mappers;
public interface MyEntityMapper {
MyEntity getById(@Param("id") String id);
}
MyEntityMapper:
उदाहरण के लिए, मान लीजिए कि आप एक जावा इंटरफ़ेस MyEntityMapper.java
कहा जाता है कि एक mybatis नक्शाकार एक्सएमएल MyEntityMapper.xml
बुलाया config से जोड़ा जाना चाहिए डालते हैं। xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="non.existent.package.NonExistentMapper">
<resultMap id="MyEntityResultmap" type="MyEntity">
<!-- some result map stuff here -->
</resultMap>
<select id="getByUuid" resultMap="MyEntityResultMap">
<!-- some sql code here -->
</select>
</mapper>
ध्यान दें कि namespace
पर MyEntityMapper.xml
में तत्व कुछ गैर मौजूद नक्शा non.existent.package.NonExistentMapper
पर इंगित कर रहा है, जब वास्तव में यह my.mappers.MyEntityMapper
पर इंगित करना चाहिए।
मुझे Google से प्यार है। यह पूछने के 5 मिनट बाद, Google लिंक मैंने केवल इस प्रश्न पर अंक पोस्ट किए। – ripper234