package demo.model;
import java.util.ArrayList;
import java.util.List;
public class LoginExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public LoginExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
整合了mybatis spring springMVC框架,使用者只要需要在mysql数据中定义一个test的数据库,和一个login的表,字段名为 int id、string name、string password的字段,即可。然后通过config.properties的设置好自己的数据库访问路径和密码。然后访问地址: http://localhost:8080/demo3/LoginController/showLogin.do?id=1 访问,即可得到打印出通过id查询的index.jsp打印的网页。
资源推荐
资源详情
资源评论
收起资源包目录
demo3.rar (84个子文件)
demo3
demo3
.project 2KB
.mymetadata 288B
src
config.properties 171B
spring-mybatis.xml 5KB
demo
service
AreaServiceI.java 162B
LoginService.java 519B
AreaServiceImpl.java 617B
model
Area.java 510B
City.java 350B
LoginExample.java 7KB
Login.java 623B
controller
AreaController.java 727B
LoginController.java 682B
dao
LoginMapper.java 999B
AreaMapper.java 320B
CityMapper.java 320B
mapping
CityMapper.xml 2KB
AreaMapper.xml 2KB
LoginMapper.xml 7KB
spring-mvc.xml 2KB
log4j.properties 531B
spring.xml 678B
mybatis.log 141KB
WebRoot
WEB-INF
classes
config.properties 171B
spring-mybatis.xml 5KB
demo
service
AreaServiceI.class 218B
LoginService.class 1KB
AreaServiceImpl.class 1KB
model
Area.class 1KB
Login.class 1KB
LoginExample$GeneratedCriteria.class 4KB
City.class 853B
LoginExample.class 2KB
LoginExample$Criterion.class 2KB
LoginExample$Criteria.class 2KB
controller
AreaController.class 1KB
LoginController.class 1KB
dao
AreaMapper.class 367B
LoginMapper.class 999B
CityMapper.class 367B
mapping
CityMapper.xml 2KB
AreaMapper.xml 2KB
LoginMapper.xml 7KB
spring-mvc.xml 2KB
test
mybatis
MybatisTest.class 2KB
log4j.properties 531B
spring.xml 678B
lib
fastjson-1.1.27.jar 348KB
spring-test-3.2.0.RELEASE.jar 441KB
log4j-1.2.16.jar 470KB
druid-0.2.10.jar 1.43MB
spring-expression-3.2.0.RELEASE.jar 189KB
spring-beans-3.2.0.RELEASE.jar 591KB
spring-core-3.2.1.RELEASE.jar 843KB
spring-jdbc-3.1.1.RELEASE.jar 395KB
aspectjweaver-1.7.0.jar 1.71MB
spring-context-3.2.0.RELEASE.jar 834KB
commons-logging-1.1.1.jar 59KB
jackson-core-asl-1.9.12.jar 227KB
jackson-mapper-asl-1.9.12.jar 762KB
spring-web-3.2.0.RELEASE.jar 610KB
mybatis-spring-1.1.1.jar 40KB
spring-webmvc-3.2.0.RELEASE.jar 621KB
junit-4.10.jar 247KB
commons-fileupload-1.2.2.jar 58KB
hamcrest-core-1.3.jar 44KB
spring-aop-3.2.0.RELEASE.jar 327KB
aopalliance-1.0.jar 4KB
mysql-connector-java-5.1.21.jar 809KB
spring-tx-3.1.1.RELEASE.jar 241KB
mybatis-3.1.1.jar 636KB
web.xml 2KB
error.jsp 815B
index.jsp 887B
success.jsp 815B
META-INF
MANIFEST.MF 36B
.myeclipse
.settings
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.wst.common.project.facet.core.xml 252B
org.eclipse.jdt.core.prefs 364B
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.wst.common.component 528B
.jsdtscope 500B
test
test
mybatis
MybatisTest.java 900B
.classpath 669B
共 84 条
- 1
资源评论
- 柠檬_Enter2015-01-26功能还可以,不过项目事务控制没生效
- tianxian2082013-11-26功能还可以,不过项目事务控制没生效
- qjtimes20092013-12-14很简单的例子.
- li3716053572014-05-29非常好的demo,感谢楼主的分享
- blackwhitecai2014-02-12功能还可以,不过项目事务控制没生效
qq513283439
- 粉丝: 166
- 资源: 140
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功