本文整理汇总了Java中org.apache.ibatis.annotations.MapKey类的典型用法代码示例。如果您正苦于以下问题:Java MapKey类的具体用法?Java MapKey怎么用?Java MapKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MapKey类属于org.apache.ibatis.annotations包,在下文中一共展示了MapKey类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMapKey
import org.apache.ibatis.annotations.MapKey; //导入依赖的package包/类
private String getMapKey(Method method) {
String mapKey = null;
if (Map.class.isAssignableFrom(method.getReturnType())) {
final MapKey mapKeyAnnotation = method.getAnnotation(MapKey.class);
if (mapKeyAnnotation != null) {
mapKey = mapKeyAnnotation.value();
}
}
return mapKey;
}
示例2: getMapKey
import org.apache.ibatis.annotations.MapKey; //导入依赖的package包/类
private String getMapKey(Method method) {
String mapKey = null;
if (Map.class.isAssignableFrom(method.getReturnType())) {
//如果返回类型是map类型的,查看该method是否有MapKey注解。如果有这个注解,将这个注解的值作为map的key
final MapKey mapKeyAnnotation = method.getAnnotation(MapKey.class);
if (mapKeyAnnotation != null) {
mapKey = mapKeyAnnotation.value();
}
}
return mapKey;
}
示例3: selectMap
import org.apache.ibatis.annotations.MapKey; //导入依赖的package包/类
@SelectProvider(type = StatementProvider.class, method = "provideSelect")
@MapKey("id")
Map<T, S> selectMap(S param);
示例4: getAMapOfUsers
import org.apache.ibatis.annotations.MapKey; //导入依赖的package包/类
@Select("select id, name from users")
@MapKey("id")
Map<Integer, User<String>> getAMapOfUsers();
示例5: selectAsMap
import org.apache.ibatis.annotations.MapKey; //导入依赖的package包/类
@Select("select * from person")
@MapKey("id")
Map<Integer, Person> selectAsMap();
示例6: findMap
import org.apache.ibatis.annotations.MapKey; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
@MapKey("id")
public <PK> Map<PK, T> findMap(PK... ids) {
return getSqlSession().selectMap("findMap", ids, "id");
}
示例7: findMap
import org.apache.ibatis.annotations.MapKey; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@MapKey("id")
<PK> Map<PK, T> findMap(PK... ids);