param

关于mybatis的@Param注解和参数

半城伤御伤魂 提交于 2019-12-11 13:59:40
1,使用@Param注解 当以下面的方式进行写SQL语句时: @Select("select column from table where userid = #{userid} ") public int selectColumn(int userid); 当你使用了使用@Param注解来声明参数时,如果使用 #{} 或 ${} 的方式都可以。 @Select("select column from table where userid = ${userid} ") public int selectColumn(@Param("userid") int userid); 当你不使用@Param注解来声明参数时,必须使用使用 #{}方式。如果使用 ${} 的方式,会报错。 @Select("select column from table where userid = ${userid} ") public int selectColumn(@Param("userid") int userid); 2,不使用@Param注解 不使用@Param注解时,参数只能有一个,并且是Javabean。在SQL语句里可以引用JavaBean的属性,而且只能引用JavaBean的属性。 // 这里id是user的属性 @Select("SELECT * from Table where id

COM Interface as a param of WinRT ref class, how it possible?

爱⌒轻易说出口 提交于 2019-12-11 11:26:09
问题 How I can define this class correctly: public ref class WICBMP sealed { void Load(IWICBitmapSource ^wicBitmapSource); }; 回答1: This is not possible. Only Windows Runtime types may be used when declaring members of a Windows Runtime interface (in this specific case, the compiler will need to generate an interface that declares your Load member function). You can't even do this if you try to define the interface in IDL. A runtime class can implement COM interfaces that are not Windows Runtime

Vue项目注释风格

ぃ、小莉子 提交于 2019-12-11 07:39:49
Vue项目注释风格 注释说明: 一. data属性说明: 【1】、单行属性,注释写在行尾 good: activeName: ‘actList’,// 活动名称 bad: // 活动名称 activeName: ‘actList’, 【2】、多行属性,注释写在行上 good: // 表格配置 tableConfig: [ { name: “SKU”, val: “product_model” }, { name: “活动已售”, val: “sold” }, { name: “待拼成订单”, val: “pending” }, ], bad: tableConfig: [ // 表格配置 { name: “SKU”, val: “product_model” }, { name: “活动已售”, val: “sold” }, { name: “待拼成订单”, val: “pending” }, ], Array>Object结构的,只注释第一个对象内部属性接可。 good: tableConfig: [ { name: “SKU”,//表头名字 val: “product_model”//对应的接口字 }, { name: “活动已售”, val: “sold” }, { name: “待拼成订单”, val: “pending” }, ], bad: tableConfig: [

JSF accessing backing map object

别等时光非礼了梦想. 提交于 2019-12-11 06:18:53
问题 I have a jsp subview page that I have passed a parameter to and I want to then pass that parameter to a map's get() method that is stored in a session bean. Ex: <h:panelGrid id="panelGrid1" rendered="#{MySessionBean[param.id].showPanelGrid1}"> ... </h:panelGrid> In the above example MySessionBean implements the Map interface and I have my own custom get method that will create an object and put it in the map if none exists for the key [params.id]. When I run the code in debug mode my get

Unable to cast from XRTreeFrag into XNodeSet

南笙酒味 提交于 2019-12-11 04:53:08
问题 I have the following test code... I am trying to pass a node-set as a param. After many hours, i finally was able to pass it to my template. How I pass my node-set to the template: <xsl:call-template name="listing"> <xsl:with-param name="customData"> <xsl:apply-templates select="exslt:node-set($data)"/> </xsl:with-param> </xsl:call-template> How my template receives it: <xsl:template name="listing"> <xsl:param name="customData" select="/.."/> <xsl:variable name="data"> <xsl:choose> <xsl:when

吃透Shiro源码第四天

情到浓时终转凉″ 提交于 2019-12-11 03:22:54
文章目录 技术手法 (1)究竟什么是缓存 (2)用Map作为缓存实现 (3)如何管理缓存生命周期 (4)AOP解析方法上的注解思路 重点研究类 技术手法 (1)究竟什么是缓存 缓存这个词语,我耳朵都快听出茧子了,什么Redis、Ecache。不过,到底什么是缓存,说实在的,我一直很模糊其概念。今天终于接近了缓存代码的源头。缓存到底是什么?我的总结:缓存对象是一个可以封装多组键值对的特殊对象。因此,缓存可以视为一种容器。 如下代码展示了缓存最顶层的接口。原来缓存一点都不神秘,它就是一种可以用来增删对象的容器。 public interface Cache < K , V > . . . /** * 存 * * @param key key * @param value value */ void put ( K key , V value ) throws CacheException ; /** * 取 * * @param key key * @return value */ V get ( K key ) throws CacheException ; /** * 删 * * @param k key * @return value */ V remove ( K k ) throws CacheException ; (2)用Map作为缓存实现 既然缓存是容器

集成极光推送-链式调用

最后都变了- 提交于 2019-12-11 02:38:18
很多 app都要用到推送,当时每次封装成工具类的时候方法形参太多 可阅读性变得很差 也不方便扩展,所有下定决心改改屎山 首先我们来写一个配置吧 这里使用springboot的 @ConfigurationProperties(prefix = "push") 将获取到的信息 放在配置文件里即可 // key private String appKey; // secret private String masterSecret; // ios下是否是开发环境 private Integer product; 推送设备枚举 public enum PushDeviceEnum { /** * 全部设备 */ ALL(0, "ALL"), /*** * IOS */ IOS(4, "ios"), /** * android */ ANDROID(3, "android"); private Integer index; private String name; PushDeviceEnum(Integer index, String name) { this.index = index; this.name = name; } public Integer getIndex() { return this.index; } public static PushDeviceEnum

miniapp之登录、授权和支付

◇◆丶佛笑我妖孽 提交于 2019-12-10 22:59:50
微信小程序代码实现(登录、授权和支付) ==整体流程看上一篇博客,或者去微信公众平台查看文档== == 只列出核心代码,详细代码见码云 michaelben == 登录 // //小程序端 // app.js App({ onLaunch: function () { var that=this // // 登录 wx.login({ success: res => { console.log("code",res.code) wx.request({ url: that.globalData.URL+"login/", data:{ "code":res.code }, header:{ "content-type":"application/json" }, method:"POST", success:function(e){ console.log(e) wx.setStorageSync("token", e.data.data.token) } }) //发送 res.code 到后台换取 openId, sessionKey, unionId } }) // onShow:function(e){ // // console.log("show",e) // }, // onHide:function(){ // console.log("hide") // }, /

抽取dao层,service层

允我心安 提交于 2019-12-10 20:14:27
一.后台支持(dao与service) 1.1 Dao层 1.1.1 创建BaseRepsitory接口 @NoRepositoryBean : 让Spring管理的时候不要为它创建实现 因为其下有多个子接口,创建实现类时,不知道具体创建哪个 /** * 公共的父Repository * @param <T> * @param <ID> */ @NoRepositoryBean public interface BaseRepository<T,ID extends Serializable> extends JpaRepository<T,ID>,JpaSpecificationExecutor<T> { } 1.1.2 EmployeeRepsitory 注意: 改成继承 BaseRepsitory 加入泛型类型 public interface EmployeeRepository extends BaseRepository<Employee,Long>{ ... } 1.2 Service层 1.2.1 IBaseService:父接口 定义一些方法 /** * Service的父接口(所有service都有CRUD) */ public interface IBaseService<T, ID extends Serializable> { //添加或者修改 void

DFS_BFS(深度优先搜索 和 广度优先搜索)

狂风中的少年 提交于 2019-12-10 20:03:47
package com.rao.graph; import java.util.LinkedList; /** * @author Srao * @className BFS_DFS * @date 2019/12/10 19:16 * @package com.rao.graph * @Description 深度优先搜索 和 广度优先搜索 */ public class BFS_DFS { /** * 图的顶点 */ private static class Vertex{ int data; Vertex(int data){ this.data = data; } } /** * 图(邻接表) */ private static class Graph{ private int size; private Vertex[] vertices; //存放每个顶点的链表 private LinkedList<Integer>[] adj; Graph(int size){ this.size = size; vertices = new Vertex[size]; adj = new LinkedList[size]; for (int i = 0; i < size; i++) { vertices[i] = new Vertex(i); adj[i] = new