Skip to content

Instantly share code, notes, and snippets.

@sasajib
Created June 3, 2015 00:56
Show Gist options
  • Save sasajib/eb4c98492511aa429582 to your computer and use it in GitHub Desktop.
Save sasajib/eb4c98492511aa429582 to your computer and use it in GitHub Desktop.
Official mybatis generator output example
package com.webdev.model;
import java.util.Date;
public class Comment {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Comment.Id
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
private Long id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Comment.UserId
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
private Integer userid;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Comment.PostId
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
private Integer postid;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Comment.ParentId
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
private Long parentid;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Comment.TotalReply
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
private Integer totalreply;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Comment.CreatedDate
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
private Date createddate;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Comment.UpdatedDate
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
private Date updateddate;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Comment.Depth
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
private Integer depth;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Comment.Content
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
private String content;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Comment.Id
*
* @return the value of Comment.Id
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Comment.Id
*
* @param id the value for Comment.Id
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Comment.UserId
*
* @return the value of Comment.UserId
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public Integer getUserid() {
return userid;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Comment.UserId
*
* @param userid the value for Comment.UserId
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public void setUserid(Integer userid) {
this.userid = userid;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Comment.PostId
*
* @return the value of Comment.PostId
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public Integer getPostid() {
return postid;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Comment.PostId
*
* @param postid the value for Comment.PostId
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public void setPostid(Integer postid) {
this.postid = postid;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Comment.ParentId
*
* @return the value of Comment.ParentId
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public Long getParentid() {
return parentid;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Comment.ParentId
*
* @param parentid the value for Comment.ParentId
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public void setParentid(Long parentid) {
this.parentid = parentid;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Comment.TotalReply
*
* @return the value of Comment.TotalReply
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public Integer getTotalreply() {
return totalreply;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Comment.TotalReply
*
* @param totalreply the value for Comment.TotalReply
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public void setTotalreply(Integer totalreply) {
this.totalreply = totalreply;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Comment.CreatedDate
*
* @return the value of Comment.CreatedDate
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public Date getCreateddate() {
return createddate;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Comment.CreatedDate
*
* @param createddate the value for Comment.CreatedDate
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public void setCreateddate(Date createddate) {
this.createddate = createddate;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Comment.UpdatedDate
*
* @return the value of Comment.UpdatedDate
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public Date getUpdateddate() {
return updateddate;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Comment.UpdatedDate
*
* @param updateddate the value for Comment.UpdatedDate
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public void setUpdateddate(Date updateddate) {
this.updateddate = updateddate;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Comment.Depth
*
* @return the value of Comment.Depth
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public Integer getDepth() {
return depth;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Comment.Depth
*
* @param depth the value for Comment.Depth
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public void setDepth(Integer depth) {
this.depth = depth;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Comment.Content
*
* @return the value of Comment.Content
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public String getContent() {
return content;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Comment.Content
*
* @param content the value for Comment.Content
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public void setContent(String content) {
this.content = content;
}
}
package com.webdev.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class CommentExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public CommentExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
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(Long value) {
addCriterion("Id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("Id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("Id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("Id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("Id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("Id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("Id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("Id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("Id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("Id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUseridIsNull() {
addCriterion("UserId is null");
return (Criteria) this;
}
public Criteria andUseridIsNotNull() {
addCriterion("UserId is not null");
return (Criteria) this;
}
public Criteria andUseridEqualTo(Integer value) {
addCriterion("UserId =", value, "userid");
return (Criteria) this;
}
public Criteria andUseridNotEqualTo(Integer value) {
addCriterion("UserId <>", value, "userid");
return (Criteria) this;
}
public Criteria andUseridGreaterThan(Integer value) {
addCriterion("UserId >", value, "userid");
return (Criteria) this;
}
public Criteria andUseridGreaterThanOrEqualTo(Integer value) {
addCriterion("UserId >=", value, "userid");
return (Criteria) this;
}
public Criteria andUseridLessThan(Integer value) {
addCriterion("UserId <", value, "userid");
return (Criteria) this;
}
public Criteria andUseridLessThanOrEqualTo(Integer value) {
addCriterion("UserId <=", value, "userid");
return (Criteria) this;
}
public Criteria andUseridIn(List<Integer> values) {
addCriterion("UserId in", values, "userid");
return (Criteria) this;
}
public Criteria andUseridNotIn(List<Integer> values) {
addCriterion("UserId not in", values, "userid");
return (Criteria) this;
}
public Criteria andUseridBetween(Integer value1, Integer value2) {
addCriterion("UserId between", value1, value2, "userid");
return (Criteria) this;
}
public Criteria andUseridNotBetween(Integer value1, Integer value2) {
addCriterion("UserId not between", value1, value2, "userid");
return (Criteria) this;
}
public Criteria andPostidIsNull() {
addCriterion("PostId is null");
return (Criteria) this;
}
public Criteria andPostidIsNotNull() {
addCriterion("PostId is not null");
return (Criteria) this;
}
public Criteria andPostidEqualTo(Integer value) {
addCriterion("PostId =", value, "postid");
return (Criteria) this;
}
public Criteria andPostidNotEqualTo(Integer value) {
addCriterion("PostId <>", value, "postid");
return (Criteria) this;
}
public Criteria andPostidGreaterThan(Integer value) {
addCriterion("PostId >", value, "postid");
return (Criteria) this;
}
public Criteria andPostidGreaterThanOrEqualTo(Integer value) {
addCriterion("PostId >=", value, "postid");
return (Criteria) this;
}
public Criteria andPostidLessThan(Integer value) {
addCriterion("PostId <", value, "postid");
return (Criteria) this;
}
public Criteria andPostidLessThanOrEqualTo(Integer value) {
addCriterion("PostId <=", value, "postid");
return (Criteria) this;
}
public Criteria andPostidIn(List<Integer> values) {
addCriterion("PostId in", values, "postid");
return (Criteria) this;
}
public Criteria andPostidNotIn(List<Integer> values) {
addCriterion("PostId not in", values, "postid");
return (Criteria) this;
}
public Criteria andPostidBetween(Integer value1, Integer value2) {
addCriterion("PostId between", value1, value2, "postid");
return (Criteria) this;
}
public Criteria andPostidNotBetween(Integer value1, Integer value2) {
addCriterion("PostId not between", value1, value2, "postid");
return (Criteria) this;
}
public Criteria andParentidIsNull() {
addCriterion("ParentId is null");
return (Criteria) this;
}
public Criteria andParentidIsNotNull() {
addCriterion("ParentId is not null");
return (Criteria) this;
}
public Criteria andParentidEqualTo(Long value) {
addCriterion("ParentId =", value, "parentid");
return (Criteria) this;
}
public Criteria andParentidNotEqualTo(Long value) {
addCriterion("ParentId <>", value, "parentid");
return (Criteria) this;
}
public Criteria andParentidGreaterThan(Long value) {
addCriterion("ParentId >", value, "parentid");
return (Criteria) this;
}
public Criteria andParentidGreaterThanOrEqualTo(Long value) {
addCriterion("ParentId >=", value, "parentid");
return (Criteria) this;
}
public Criteria andParentidLessThan(Long value) {
addCriterion("ParentId <", value, "parentid");
return (Criteria) this;
}
public Criteria andParentidLessThanOrEqualTo(Long value) {
addCriterion("ParentId <=", value, "parentid");
return (Criteria) this;
}
public Criteria andParentidIn(List<Long> values) {
addCriterion("ParentId in", values, "parentid");
return (Criteria) this;
}
public Criteria andParentidNotIn(List<Long> values) {
addCriterion("ParentId not in", values, "parentid");
return (Criteria) this;
}
public Criteria andParentidBetween(Long value1, Long value2) {
addCriterion("ParentId between", value1, value2, "parentid");
return (Criteria) this;
}
public Criteria andParentidNotBetween(Long value1, Long value2) {
addCriterion("ParentId not between", value1, value2, "parentid");
return (Criteria) this;
}
public Criteria andTotalreplyIsNull() {
addCriterion("TotalReply is null");
return (Criteria) this;
}
public Criteria andTotalreplyIsNotNull() {
addCriterion("TotalReply is not null");
return (Criteria) this;
}
public Criteria andTotalreplyEqualTo(Integer value) {
addCriterion("TotalReply =", value, "totalreply");
return (Criteria) this;
}
public Criteria andTotalreplyNotEqualTo(Integer value) {
addCriterion("TotalReply <>", value, "totalreply");
return (Criteria) this;
}
public Criteria andTotalreplyGreaterThan(Integer value) {
addCriterion("TotalReply >", value, "totalreply");
return (Criteria) this;
}
public Criteria andTotalreplyGreaterThanOrEqualTo(Integer value) {
addCriterion("TotalReply >=", value, "totalreply");
return (Criteria) this;
}
public Criteria andTotalreplyLessThan(Integer value) {
addCriterion("TotalReply <", value, "totalreply");
return (Criteria) this;
}
public Criteria andTotalreplyLessThanOrEqualTo(Integer value) {
addCriterion("TotalReply <=", value, "totalreply");
return (Criteria) this;
}
public Criteria andTotalreplyIn(List<Integer> values) {
addCriterion("TotalReply in", values, "totalreply");
return (Criteria) this;
}
public Criteria andTotalreplyNotIn(List<Integer> values) {
addCriterion("TotalReply not in", values, "totalreply");
return (Criteria) this;
}
public Criteria andTotalreplyBetween(Integer value1, Integer value2) {
addCriterion("TotalReply between", value1, value2, "totalreply");
return (Criteria) this;
}
public Criteria andTotalreplyNotBetween(Integer value1, Integer value2) {
addCriterion("TotalReply not between", value1, value2, "totalreply");
return (Criteria) this;
}
public Criteria andCreateddateIsNull() {
addCriterion("CreatedDate is null");
return (Criteria) this;
}
public Criteria andCreateddateIsNotNull() {
addCriterion("CreatedDate is not null");
return (Criteria) this;
}
public Criteria andCreateddateEqualTo(Date value) {
addCriterion("CreatedDate =", value, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateNotEqualTo(Date value) {
addCriterion("CreatedDate <>", value, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateGreaterThan(Date value) {
addCriterion("CreatedDate >", value, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateGreaterThanOrEqualTo(Date value) {
addCriterion("CreatedDate >=", value, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateLessThan(Date value) {
addCriterion("CreatedDate <", value, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateLessThanOrEqualTo(Date value) {
addCriterion("CreatedDate <=", value, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateIn(List<Date> values) {
addCriterion("CreatedDate in", values, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateNotIn(List<Date> values) {
addCriterion("CreatedDate not in", values, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateBetween(Date value1, Date value2) {
addCriterion("CreatedDate between", value1, value2, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateNotBetween(Date value1, Date value2) {
addCriterion("CreatedDate not between", value1, value2, "createddate");
return (Criteria) this;
}
public Criteria andUpdateddateIsNull() {
addCriterion("UpdatedDate is null");
return (Criteria) this;
}
public Criteria andUpdateddateIsNotNull() {
addCriterion("UpdatedDate is not null");
return (Criteria) this;
}
public Criteria andUpdateddateEqualTo(Date value) {
addCriterion("UpdatedDate =", value, "updateddate");
return (Criteria) this;
}
public Criteria andUpdateddateNotEqualTo(Date value) {
addCriterion("UpdatedDate <>", value, "updateddate");
return (Criteria) this;
}
public Criteria andUpdateddateGreaterThan(Date value) {
addCriterion("UpdatedDate >", value, "updateddate");
return (Criteria) this;
}
public Criteria andUpdateddateGreaterThanOrEqualTo(Date value) {
addCriterion("UpdatedDate >=", value, "updateddate");
return (Criteria) this;
}
public Criteria andUpdateddateLessThan(Date value) {
addCriterion("UpdatedDate <", value, "updateddate");
return (Criteria) this;
}
public Criteria andUpdateddateLessThanOrEqualTo(Date value) {
addCriterion("UpdatedDate <=", value, "updateddate");
return (Criteria) this;
}
public Criteria andUpdateddateIn(List<Date> values) {
addCriterion("UpdatedDate in", values, "updateddate");
return (Criteria) this;
}
public Criteria andUpdateddateNotIn(List<Date> values) {
addCriterion("UpdatedDate not in", values, "updateddate");
return (Criteria) this;
}
public Criteria andUpdateddateBetween(Date value1, Date value2) {
addCriterion("UpdatedDate between", value1, value2, "updateddate");
return (Criteria) this;
}
public Criteria andUpdateddateNotBetween(Date value1, Date value2) {
addCriterion("UpdatedDate not between", value1, value2, "updateddate");
return (Criteria) this;
}
public Criteria andDepthIsNull() {
addCriterion("Depth is null");
return (Criteria) this;
}
public Criteria andDepthIsNotNull() {
addCriterion("Depth is not null");
return (Criteria) this;
}
public Criteria andDepthEqualTo(Integer value) {
addCriterion("Depth =", value, "depth");
return (Criteria) this;
}
public Criteria andDepthNotEqualTo(Integer value) {
addCriterion("Depth <>", value, "depth");
return (Criteria) this;
}
public Criteria andDepthGreaterThan(Integer value) {
addCriterion("Depth >", value, "depth");
return (Criteria) this;
}
public Criteria andDepthGreaterThanOrEqualTo(Integer value) {
addCriterion("Depth >=", value, "depth");
return (Criteria) this;
}
public Criteria andDepthLessThan(Integer value) {
addCriterion("Depth <", value, "depth");
return (Criteria) this;
}
public Criteria andDepthLessThanOrEqualTo(Integer value) {
addCriterion("Depth <=", value, "depth");
return (Criteria) this;
}
public Criteria andDepthIn(List<Integer> values) {
addCriterion("Depth in", values, "depth");
return (Criteria) this;
}
public Criteria andDepthNotIn(List<Integer> values) {
addCriterion("Depth not in", values, "depth");
return (Criteria) this;
}
public Criteria andDepthBetween(Integer value1, Integer value2) {
addCriterion("Depth between", value1, value2, "depth");
return (Criteria) this;
}
public Criteria andDepthNotBetween(Integer value1, Integer value2) {
addCriterion("Depth not between", value1, value2, "depth");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table Comment
*
* @mbggenerated do_not_delete_during_merge Wed Jun 03 06:42:27 BDT 2015
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
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);
}
}
}
package com.webdev.model;
import com.webdev.model.Comment;
import com.webdev.model.CommentExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CommentMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
int countByExample(CommentExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
int deleteByExample(CommentExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
int insert(Comment record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
int insertSelective(Comment record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
List<Comment> selectByExampleWithBLOBs(CommentExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
List<Comment> selectByExample(CommentExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
Comment selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
int updateByExampleSelective(@Param("record") Comment record, @Param("example") CommentExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
int updateByExampleWithBLOBs(@Param("record") Comment record, @Param("example") CommentExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
int updateByExample(@Param("record") Comment record, @Param("example") CommentExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
int updateByPrimaryKeySelective(Comment record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
int updateByPrimaryKeyWithBLOBs(Comment record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Comment
*
* @mbggenerated Wed Jun 03 06:42:27 BDT 2015
*/
int updateByPrimaryKey(Comment record);
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.webdev.model.CommentMapper" >
<resultMap id="BaseResultMap" type="com.webdev.model.Comment" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
<id column="Id" property="id" jdbcType="BIGINT" />
<result column="UserId" property="userid" jdbcType="INTEGER" />
<result column="PostId" property="postid" jdbcType="INTEGER" />
<result column="ParentId" property="parentid" jdbcType="BIGINT" />
<result column="TotalReply" property="totalreply" jdbcType="INTEGER" />
<result column="CreatedDate" property="createddate" jdbcType="TIMESTAMP" />
<result column="UpdatedDate" property="updateddate" jdbcType="TIMESTAMP" />
<result column="Depth" property="depth" jdbcType="INTEGER" />
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.webdev.model.Comment" extends="BaseResultMap" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
<result column="Content" property="content" jdbcType="LONGVARCHAR" />
</resultMap>
<sql id="Example_Where_Clause" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
<where >
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
Id, UserId, PostId, ParentId, TotalReply, CreatedDate, UpdatedDate, Depth
</sql>
<sql id="Blob_Column_List" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
Content
</sql>
<select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs" parameterType="com.webdev.model.CommentExample" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from Comment
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.webdev.model.CommentExample" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from Comment
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Long" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from Comment
where Id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
delete from Comment
where Id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.webdev.model.CommentExample" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
delete from Comment
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.webdev.model.Comment" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
insert into Comment (Id, UserId, PostId,
ParentId, TotalReply, CreatedDate,
UpdatedDate, Depth, Content
)
values (#{id,jdbcType=BIGINT}, #{userid,jdbcType=INTEGER}, #{postid,jdbcType=INTEGER},
#{parentid,jdbcType=BIGINT}, #{totalreply,jdbcType=INTEGER}, #{createddate,jdbcType=TIMESTAMP},
#{updateddate,jdbcType=TIMESTAMP}, #{depth,jdbcType=INTEGER}, #{content,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.webdev.model.Comment" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
insert into Comment
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
Id,
</if>
<if test="userid != null" >
UserId,
</if>
<if test="postid != null" >
PostId,
</if>
<if test="parentid != null" >
ParentId,
</if>
<if test="totalreply != null" >
TotalReply,
</if>
<if test="createddate != null" >
CreatedDate,
</if>
<if test="updateddate != null" >
UpdatedDate,
</if>
<if test="depth != null" >
Depth,
</if>
<if test="content != null" >
Content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=BIGINT},
</if>
<if test="userid != null" >
#{userid,jdbcType=INTEGER},
</if>
<if test="postid != null" >
#{postid,jdbcType=INTEGER},
</if>
<if test="parentid != null" >
#{parentid,jdbcType=BIGINT},
</if>
<if test="totalreply != null" >
#{totalreply,jdbcType=INTEGER},
</if>
<if test="createddate != null" >
#{createddate,jdbcType=TIMESTAMP},
</if>
<if test="updateddate != null" >
#{updateddate,jdbcType=TIMESTAMP},
</if>
<if test="depth != null" >
#{depth,jdbcType=INTEGER},
</if>
<if test="content != null" >
#{content,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.webdev.model.CommentExample" resultType="java.lang.Integer" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
select count(*) from Comment
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
update Comment
<set >
<if test="record.id != null" >
Id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.userid != null" >
UserId = #{record.userid,jdbcType=INTEGER},
</if>
<if test="record.postid != null" >
PostId = #{record.postid,jdbcType=INTEGER},
</if>
<if test="record.parentid != null" >
ParentId = #{record.parentid,jdbcType=BIGINT},
</if>
<if test="record.totalreply != null" >
TotalReply = #{record.totalreply,jdbcType=INTEGER},
</if>
<if test="record.createddate != null" >
CreatedDate = #{record.createddate,jdbcType=TIMESTAMP},
</if>
<if test="record.updateddate != null" >
UpdatedDate = #{record.updateddate,jdbcType=TIMESTAMP},
</if>
<if test="record.depth != null" >
Depth = #{record.depth,jdbcType=INTEGER},
</if>
<if test="record.content != null" >
Content = #{record.content,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
update Comment
set Id = #{record.id,jdbcType=BIGINT},
UserId = #{record.userid,jdbcType=INTEGER},
PostId = #{record.postid,jdbcType=INTEGER},
ParentId = #{record.parentid,jdbcType=BIGINT},
TotalReply = #{record.totalreply,jdbcType=INTEGER},
CreatedDate = #{record.createddate,jdbcType=TIMESTAMP},
UpdatedDate = #{record.updateddate,jdbcType=TIMESTAMP},
Depth = #{record.depth,jdbcType=INTEGER},
Content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
update Comment
set Id = #{record.id,jdbcType=BIGINT},
UserId = #{record.userid,jdbcType=INTEGER},
PostId = #{record.postid,jdbcType=INTEGER},
ParentId = #{record.parentid,jdbcType=BIGINT},
TotalReply = #{record.totalreply,jdbcType=INTEGER},
CreatedDate = #{record.createddate,jdbcType=TIMESTAMP},
UpdatedDate = #{record.updateddate,jdbcType=TIMESTAMP},
Depth = #{record.depth,jdbcType=INTEGER}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.webdev.model.Comment" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
update Comment
<set >
<if test="userid != null" >
UserId = #{userid,jdbcType=INTEGER},
</if>
<if test="postid != null" >
PostId = #{postid,jdbcType=INTEGER},
</if>
<if test="parentid != null" >
ParentId = #{parentid,jdbcType=BIGINT},
</if>
<if test="totalreply != null" >
TotalReply = #{totalreply,jdbcType=INTEGER},
</if>
<if test="createddate != null" >
CreatedDate = #{createddate,jdbcType=TIMESTAMP},
</if>
<if test="updateddate != null" >
UpdatedDate = #{updateddate,jdbcType=TIMESTAMP},
</if>
<if test="depth != null" >
Depth = #{depth,jdbcType=INTEGER},
</if>
<if test="content != null" >
Content = #{content,jdbcType=LONGVARCHAR},
</if>
</set>
where Id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.webdev.model.Comment" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
update Comment
set UserId = #{userid,jdbcType=INTEGER},
PostId = #{postid,jdbcType=INTEGER},
ParentId = #{parentid,jdbcType=BIGINT},
TotalReply = #{totalreply,jdbcType=INTEGER},
CreatedDate = #{createddate,jdbcType=TIMESTAMP},
UpdatedDate = #{updateddate,jdbcType=TIMESTAMP},
Depth = #{depth,jdbcType=INTEGER},
Content = #{content,jdbcType=LONGVARCHAR}
where Id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.webdev.model.Comment" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed Jun 03 06:42:27 BDT 2015.
-->
update Comment
set UserId = #{userid,jdbcType=INTEGER},
PostId = #{postid,jdbcType=INTEGER},
ParentId = #{parentid,jdbcType=BIGINT},
TotalReply = #{totalreply,jdbcType=INTEGER},
CreatedDate = #{createddate,jdbcType=TIMESTAMP},
UpdatedDate = #{updateddate,jdbcType=TIMESTAMP},
Depth = #{depth,jdbcType=INTEGER}
where Id = #{id,jdbcType=BIGINT}
</update>
</mapper>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment