国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

Appfuse:第一張表維護

2019-11-15 00:49:13
字體:
來源:轉載
供稿:網友
Appfuse:第一張表維護

1. 建立表userinfo

列名描述
UserID 主鍵、自增
UserName用戶名
Pwd密碼
CreateDate創建日期

2. 在src/main/resources目錄下增加文件hibernate.reveng.xml

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-reverse-engineering  SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" ><hibernate-reverse-engineering>    <type-mapping>        <!-- jdbc-type is name fom java.sql.Types -->        <sql-type jdbc-type="VARCHAR" length='1' hibernate-type="yes_no"/>        <!-- length, scale and PRecision can be used to specify the mapping precisly -->        <sql-type jdbc-type="NUMERIC" precision='1' hibernate-type="boolean"/>        <!-- the type-mappings are ordered. This mapping will be consulted last,        thus overriden by the previous one if precision=1 for the column -->        <sql-type jdbc-type="BIGINT" hibernate-type="java.lang.Long"/>        <sql-type jdbc-type="INTEGER" hibernate-type="java.lang.Long"/>        <sql-type jdbc-type="NUMERIC" hibernate-type="java.lang.Long"/>    </type-mapping>    <table-filter match-name="*" exclude="true"/>    <table-filter match-name="userinfo" exclude="false"/></hibernate-reverse-engineering>
hibernate.reveng.xml

3. 打開命令行,輸入mvn appfuse:gen-model 生成實體類userinfo.java

package com.zcmp.disappearwind.model;import com.zcmp.disappearwind.model.BaSEObject;import org.hibernate.search.annotations.DocumentId;import org.hibernate.search.annotations.Field;import org.hibernate.search.annotations.Indexed;import org.hibernate.search.annotations.IndexedEmbedded;import java.util.Date;import javax.persistence.Column;import javax.persistence.Entity;import javax.persistence.GeneratedValue;import static javax.persistence.GenerationType.IDENTITY;import javax.persistence.Id;import javax.persistence.Table;import javax.persistence.Temporal;import javax.persistence.TemporalType;import javax.persistence.GeneratedValue;import javax.persistence.GenerationType;import javax.xml.bind.annotation.XmlRootElement;import java.io.Serializable;@Entity@Table(name="userinfot",catalog="disappearwind")@Indexed@XmlRootElementpublic class Userinfo extends BaseObject implements Serializable {    private Long userId;    private Date createDate;    private String pwd;    private String userName;    @Id @GeneratedValue(strategy=IDENTITY) @DocumentId        public Long getUserId() {        return this.userId;    }        public void setUserId(Long userId) {        this.userId = userId;    }    @Temporal(TemporalType.TIMESTAMP)    @Column(name="CreateDate", length=19)    @Field    public Date getCreateDate() {        return this.createDate;    }        public void setCreateDate(Date createDate) {        this.createDate = createDate;    }        @Column(name="Pwd", length=128)    @Field    public String getPwd() {        return this.pwd;    }        public void setPwd(String pwd) {        this.pwd = pwd;    }        @Column(name="UserName", length=128)    @Field    public String getUserName() {        return this.userName;    }        public void setUserName(String userName) {        this.userName = userName;    }    public boolean equals(Object o) {        if (this == o) return true;        if (o == null || getClass() != o.getClass()) return false;        Userinfo pojo = (Userinfo) o;        if (createDate != null ? !createDate.equals(pojo.createDate) : pojo.createDate != null) return false;        if (pwd != null ? !pwd.equals(pojo.pwd) : pojo.pwd != null) return false;        if (userName != null ? !userName.equals(pojo.userName) : pojo.userName != null) return false;        return true;    }    public int hashCode() {        int result = 0;        result = (createDate != null ? createDate.hashCode() : 0);        result = 31 * result + (pwd != null ? pwd.hashCode() : 0);        result = 31 * result + (userName != null ? userName.hashCode() : 0);        return result;    }    public String toString() {        StringBuffer sb = new StringBuffer(getClass().getSimpleName());        sb.append(" [");        sb.append("userId").append("='").append(getUserId()).append("', ");        sb.append("createDate").append("='").append(getCreateDate()).append("', ");        sb.append("pwd").append("='").append(getPwd()).append("', ");        sb.append("userName").append("='").append(getUserName()).append("'");        sb.append("]");              return sb.toString();    }}
Userinfo

4. 在命令號運行mvn appfuse:gen生成頁面、Controller、menu配置等文件,注意提示輸入實體名的時候大小寫一定要和第三步生成的類名保持一致

5. 打開applicationResources_zh.properties文件,漢化各字段的名稱以及各種標題和提示信息

6. 重新部署即可


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 远安县| 洪洞县| 那坡县| 临洮县| 山阳县| 南宫市| 肃宁县| 雷波县| 嘉峪关市| 凤凰县| 错那县| 平潭县| 浙江省| 克什克腾旗| 昌江| 裕民县| 宁南县| 望谟县| 普兰店市| 娄底市| 平湖市| 建德市| 监利县| 公安县| 新密市| 石嘴山市| 平凉市| 彰化县| 迁西县| 上林县| 无棣县| 五莲县| 湘阴县| 红河县| 巴林右旗| 台东县| 静安区| 阳东县| 平定县| 邓州市| 惠东县|