Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
Message.java
MockMemcachedHandler.java
MockRedisHandler.java
MultiKeysMultiValuesDao.java
MultiKeysMultiValuesMain.java
MultiParameterSingleKeyDao.java
README.md
SingleKeyMultiValuesDao.java
SingleKeyMultiValuesMain.java
SingleKeySingeValueDao.java
SingleKeySingeValueMain.java
User.java

README.md

集成缓存

集成缓存相关文档请查看 http://mango.jfaster.org/cache.html

单key取单值

使用 SingleKeySingeValueMain 运行 SingleKeySingeValueDao

需要在数据库 jdbc:mysql://localhost:3306/mango_example 中创建下面的表

DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `uid` int(11) NOT NULL,
  `name` varchar(20) NOT NULL,
  PRIMARY KEY (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

单key取多值

使用 SingleKeyMultiValuesMain 运行 SingleKeyMultiValuesDao

需要在数据库 jdbc:mysql://localhost:3306/mango_example 中创建下面的表

DROP TABLE IF EXISTS `message`;
CREATE TABLE `message` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) NOT NULL,
  `content` varchar(100) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `key_uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

多key取多值

使用 MultiKeysMultiValuesMain 运行 MultiKeysMultiValuesDao

需要在数据库 jdbc:mysql://localhost:3306/mango_example 中创建下面的表

DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `uid` int(11) NOT NULL,
  `name` varchar(20) NOT NULL,
  PRIMARY KEY (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;