java.lang.ClassCastException: [I cannot be cast to java.lang.Integer
at com.sun.proxy.$Proxy51.deleteRecommendListByIDs(Unknown Source)
at com.xx.service.xxxService.generateDefaultRecommendList(xxxService.java:214)
at com.xx.service.xxxService.main(xxxService.java:951)
其错误来源于通过@SQL的注解实现了SQL语句的执行地方,具体的SQL如下:
@SQL(" DELETE FROM videolist_home_recommend "
+" WHERE ID IN ( :delRecords ) ")
public Integer deleteRecommendListByIDs(@SQLParam("delRecords") List delRecords);
String java.lang.Class.getName() Returns the name of the entity (class, interface, array class, primitive type, or void) represented by this Class object, as a String. …… If this class object represents a class of arrays, then the internal form of the name consists of the name of the element type preceded by one or more '[' characters representing the depth of the array nesting. The encoding of element type names is as follows: …… Element Type boolean Z byte B …… int I long J short S
在WRITE类型中,会将ID IN (:list) 这种语句自动翻译成Batch语句来处理。但是在转换成Batch来处理时,在传入的list中只有一个值时,又会根据参数个数,将Batch转化成了SingleBatch,因此造成了这种不统一的情况(两者的返回值不一样,一个是Integer,一个是int[])
@Override
public Object execute(SQLType sqlType, StatementRuntime... runtimes) {
switch (runtimes.length) {
case 0:
return 0;
case 1:
return executeSingle(runtimes[0], returnType);
default:
return executeBatch(runtimes);
}
}
我们都晓得java实现线程2种方式,一个是继承Thread,另一个是实现Runnable。
模拟窗口买票,第一例子继承thread,代码如下
package thread;
public class ThreadTest {
public static void main(String[] args) {
Thread1 t1 = new Thread1(
#include<iostream>
using namespace std;
//辅助函数,交换两数之值
template<class T>
void mySwap(T &x, T &y){
T temp = x;
x = y;
y = temp;
}
const int size = 10;
//一、用直接插入排
对日期类型的数据进行序列化和反序列化时,需要考虑如下问题:
1. 序列化时,Date对象序列化的字符串日期格式如何
2. 反序列化时,把日期字符串序列化为Date对象,也需要考虑日期格式问题
3. Date A -> str -> Date B,A和B对象是否equals
默认序列化和反序列化
import com
1. DStream的类说明文档:
/**
* A Discretized Stream (DStream), the basic abstraction in Spark Streaming, is a continuous
* sequence of RDDs (of the same type) representing a continuous st
ReplayingDecoder是FrameDecoder的子类,不熟悉FrameDecoder的,可以先看看
http://bylijinnan.iteye.com/blog/1982618
API说,ReplayingDecoder简化了操作,比如:
FrameDecoder在decode时,需要判断数据是否接收完全:
public class IntegerH
1.js中用正则表达式 过滤特殊字符, 校验所有输入域是否含有特殊符号function stripscript(s) { var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]"
经常在写shell脚本时,会碰到要以另外一个用户来执行相关命令,其方法简单记下:
1、执行单个命令:su - user -c "command"
如:下面命令是以test用户在/data目录下创建test123目录
[root@slave19 /data]# su - test -c "mkdir /data/test123"