/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 保存一个实体,null的属性也会保存,不会使用数据库默认值 */ intinsert(T model);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 保存一个实体,null的属性不会保存,会使用数据库默认值 */ intinsertSelective(T model);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 批量插入,支持批量插入的数据库可以使用,另外该接口限制实体包含`id`属性并且必须为自增列 */ intinsertList(List<T> list);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据主键更新实体全部字段,null值会被更新 */ intupdateByPrimaryKey(T model);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据主键更新属性不为null的值 */ intupdateByPrimaryKeySelective(T model);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据Example条件更新实体`model`包含的全部属性,null值会被更新 */ intupdateByExample(T model, Object example);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据Example条件更新实体`model`包含的不是null的属性值 */ intupdateByExampleSelective(T model, Object example);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据实体属性作为条件进行删除,查询条件使用等号 */ intdelete(T model);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据实体id删除 */ intdeleteById(int id);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据Example条件删除数据 */ intdeleteByExample(Object example);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据主键字符串进行删除,类中只有存在一个带有@Id注解的字段 * * @param ids 如 "1,2,3,4" */ intdeleteByIds(String ids);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据主键字段进行删除,方法参数必须包含完整的主键属性 */ intdeleteByPrimaryKey(Object key);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据实体中的属性值进行查询,查询条件使用等号 */ List<T> select(T model);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据实体中的id查询实体 */ T selectById(int id);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 查询全部结果 */ List<T> selectAll();
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据Example条件进行查询 */ List<T> selectByExample(Object example);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据example条件和RowBounds进行分页查询 */ List<T> selectByExampleAndRowBounds(Object example, RowBounds rowBounds);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据主键字符串进行查询,类中只有存在一个带有@Id注解的字段 * * @param ids 如 "1,2,3,4" */ List<T> selectByIds(String ids);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据主键字段进行查询,方法参数必须包含完整的主键属性,查询条件使用等号 */ T selectByPrimaryKey(Object key);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据实体中的属性查询总数,查询条件使用等号 */ intselectCount(T model);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据Example条件进行查询总数 */ intselectCountByExample(Object example);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据实体中的属性进行查询,只能有一个返回值,有多个结果是抛出异常,查询条件使用等号 */ T selectOne(T model);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据实体属性和RowBounds进行分页查询 */ List<T> selectByRowBounds(T model, RowBounds rowBounds);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 单表分页查询 */ PageInfo selectPage(int pageNum, int pageSize, T model);
/** * Created by JoyLau on 4/6/2017. * 2587038142.liu@gmail.com * 根据Example条件进行分页查询 */ PageInfo selectPageByExample(int pageNum, int pageSize, Object example);
-h <hostname> Server hostname (default 127.0.0.1) -p <port> Server port (default 6379) -s <socket> Server socket (overrides host and port) -a <password> Password for Redis Auth -c <clients> Number of parallel connections (default 50) -n <requests> Total number of requests (default 100000) -d <size> Data size of SET/GET value in bytes (default 2) -dbnum <db> SELECT the specified db number (default 0) -k <boolean> 1=keep alive 0=reconnect (default 1) -r <keyspacelen> Use random keys for SET/GET/INCR, random values for SADD Using this option the benchmark will expand the string __rand_int__ inside an argument with a 12 digits number in the specified range from 0 to keyspacelen-1. The substitution changes every time a command is executed. Default tests use this to hit random keys in the specified range. -P <numreq> Pipeline <numreq> requests. Default 1 (no pipeline). -q Quiet. Just show query/sec values --csv Output in CSV format -l Loop. Run the tests forever -t <tests> Only run the comma separated list of tests. The test names are the same as the ones produced as output. -I Idle mode. Just open N idle connections and wait.
Examples:
Run the benchmark with the default configuration against 127.0.0.1:6379: $ redis-benchmark
Use 20 parallel clients, for a total of 100k requests, against 192.168.1.1: $ redis-benchmark -h 192.168.1.1 -p 6379 -n 100000 -c 20
Fill 127.0.0.1:6379 with about 1 million keys only using the SET test: $ redis-benchmark -t set -n 1000000 -r 100000000
Benchmark 127.0.0.1:6379 for a few commands producing CSV output: $ redis-benchmark -t ping,set,get -n 100000 --csv
Benchmark a specific command line: $ redis-benchmark -r 10000 -n 10000 eval'return redis.call("ping")' 0
Fill a list with 10000 random elements: $ redis-benchmark -r 10000 -n 10000 lpush mylist __rand_int__
On user specified command lines __rand_int__ is replaced with a random integer with a range of values selected by the -r option.
java.sql.SQLException: Incorrect string value: '\xF0\x9F\x92\x94'for colum n 'name' at row 1 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620) at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1662) at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1581)
<!-- ~ The MIT License (MIT) ~ ~ Copyright (c) 2017 2587038142@qq.com ~ ~ Permission is hereby granted, free of charge, to any person obtaining a copy ~ of this software and associated documentation files (the "Software"), to deal ~ in the Software without restriction, including without limitation the rights ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ~ copies of the Software, and to permit persons to whom the Software is ~ furnished to do so, subject to the following conditions: ~ ~ The above copyright notice and this permission notice shall be included in ~ all copies or substantial portions of the Software. ~ ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ~ THE SOFTWARE. -->