Problems mapping some mapper methods

7 views
Skip to first unread message

Jackie G.

unread,
Aug 2, 2011, 12:30:14 PM8/2/11
to mybatis-user
I have 2 methods...

static final String SELECT_RESOURCES_LIKE_KEY = "select
PROPERTYID,STOREID,LANGUAGEID,"+
"TEXTKEY,TEXTVALUE, BUNDLE, DESCRIPTION "+
"from XPROPERTY_ITEM "+
"where UPPER(TEXTKEY) like #{textKey} "+
"and LANGUAGEID = #{languageId} "+
"order by TEXTKEY " +
"FETCH FIRST 25 ROWS ONLY";

@Select(SELECT_RESOURCES_LIKE_KEY)
@Results()
public List<PropertyItem> selectResourcesLikeKey(@Param("textKey")
String textKey, @Param("languageId") Integer languageId);

This one seems to work just fine, however, within the same mapper
interface I have...

static final String SELECT_RESOURCES_BY_KEY_LANGUAGE_STORE_ID_BUNDLE
="select PROPERTYID,STOREID,LANGUAGEID,"+
"TEXTKEY,TEXTVALUE, BUNDLE, DESCRIPTION "+
"from XPROPERTY_ITEM "+
"where TEXTKEY = #{textKey} "+
"and LANGUAGEID = #{languageId} "+
"and STOREID = #{storeId} "+
"AND BUNDLE = #{bundle}";

@Select(SELECT_RESOURCES_BY_KEY_LANGUAGE_STORE_ID_BUNDLE)
public PropertyItem
selectResourcesByKeyLanguageStoreIdBundle(@Param("textKey") String
textKey, @Param("languageId") Integer languageId, @Param("storeId")
Integer storeId, @Param("bundle") String bundle);

This fails with a error of

SEVERE: Servlet.service() for servlet dispatcher threw exception
java.lang.IllegalArgumentException: Mapped Statements collection does
not contain value for
com.anfcorp.ecommerce.textmanagement.mapper.PropertyItemMapper.selectResourcesByKeyLanguageStoreIdBundle
at org.apache.ibatis.session.Configuration
$StrictMap.get(Configuration.java:593)
at
org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:
393)
at
org.apache.ibatis.binding.MapperMethod.setupCommandType(MapperMethod.java:
160)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:
48)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:37)
at $Proxy22.selectResourcesByKeyLanguageStoreIdBundle(Unknown Source)


Please help this is really holding us up and hurting my chances of
pushing out a mybatis mapping solution.

Jeff Butler

unread,
Aug 5, 2011, 4:28:10 PM8/5/11
to mybati...@googlegroups.com
Is there an XML file that corresponds to this mapper? It's not
required, but I'm wondering if there might be some methods in XML that
duplicate some, but not all, of the methods in this interface.

Jeff Butler

Jackie Gleason

unread,
Aug 5, 2011, 8:10:10 PM8/5/11
to mybati...@googlegroups.com

Actually I was a bad developer and got it working by checking out an older version and redoing all of the changes, incremently, until I figured out it was something in the mapper. Haven't really looked at the diff in detail yet but I can monday. Will keep you informed if interested, but I also redid some logic to get around the method.

Thanks

Reply all
Reply to author
Forward
0 new messages