1. 建立表userinfo

列名 描述
UserID  主键、自增
UserName 用户名
Pwd 密码
CreateDate 创建日期

2. 在src/main/resources目录下增加文件hibernate.reveng.xml,并在pom.xml中配置build子标签

<?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

 <plugin>
<groupId>org.appfuse.plugins</groupId>
<artifactId>appfuse-maven-plugin</artifactId>
<version>${project.parent.version}</version>
<configuration>
<componentProperties>
<revengfile>src/main/resources/hibernate.reveng.xml</revengfile>
</componentProperties>
<genericCore>${amp.genericCore}</genericCore>
<fullSource>${amp.fullSource}</fullSource>
</configuration>
<dependencies>
<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
</dependency>
</dependencies>
</plugin>

pom的配置

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
@XmlRootElement
public 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. 重新部署即可

Appfuse:第一张表维护的更多相关文章

  1. mysql连表查空,查询第二张表中没有第一张表中的数据

    select consumer_id,user_name,mobile,invite_code from csr_consumer where invite_count<(select coun ...

  2. 级联两个bootstrap-table。一张表显示相关的数据,通过点击这张表的某一行,传过去对应的ID,刷新另外一张表。

    二张表的代码(我用的插件,大家可以去网上直接下载http://issues.wenzhixin.net.cn/bootstrap-table/): <div class="contai ...

  3. sql语句左链接left join--3张表关联

    表A---------------------------------关联第一张表B-----------------------关联第二张表c select * fomr 表名A left join ...

  4. 【第十五篇】easyui datagrid的列编辑,同时插入两张表的数据进去

    看图说话. 需求:插入两张表,上面的表单是第一张表的内容,下面的两个表格是第二张详情表的内容,跟第一张表的id关联 第二张表有一个列是需要用户手动填写添加的. 国际惯例,上代码 <div id= ...

  5. 利用pymysql同时修改两张表的数据

    使用pymysql操作数据库中相关联的两张表需求:两张表中分别有一个字段是json格式,需要往json中再插入一个属性值’container_cloud’=’fasle’. import pymysq ...

  6. Ajax案例:三级联动查询员工的信息(三张表进行内连接)

    需求分析: 通过数据库连接池,可以查询到数据库中员工的各种信息,通过点击下拉框的方式实现三级联动,即:没有点击city下拉框,后面两个下拉框中没有值,这样,点击city下拉框,department下拉 ...

  7. 多对多第三张表的创建方式 和 forms组件的使用

    目录 一.多对多第三张表的创建 1. 全自动方式 (1)实现代码 (2)优点和不足 2. 纯手撸方式(了解) (1)实现代码 (2)优点和不足 3. 半自动方式(推荐使用) (1)实现代码 (2)优点 ...

  8. sql 查出一张表中重复的所有记录数据

    1.在面试的时候碰到一个 问题,就是让写一张表中有id和name 两个字段,查询出name重复的所有数据,现在列下: select * from xi a where (a.username) in ...

  9. SQLSERVER中如何快速比较两张表的不一样

    SQLSERVER中如何快速比较两张表的不一样 不知不觉要写2014年的最后一篇博文了~ 一般来说,如何检测两张表的内容是否一致,体现在复制的时候发布端和订阅端的两端的数据上面 我这里罗列了一些如何从 ...

随机推荐

  1. ABP(现代ASP.NET样板开发框架)系列之18、ABP应用层——权限验证

    点这里进入ABP系列文章总目录 ABP(现代ASP.NET样板开发框架)系列之18.ABP应用层——权限验证 ABP是“ASP.NET Boilerplate Project (ASP.NET样板项目 ...

  2. 使用google 语言 api 来实现整个网站的翻译

    ---恢复内容开始--- 使用google 语言 api 来实现整个网站的翻译,这时我们可以利用免费的google api来做处理来实现多语言的功能. 放在 HTML 文件中 <div id=& ...

  3. windows下获取IP地址的两种方法

    windows下获取IP地址的两种方法: 一种可以获取IPv4和IPv6,但是需要WSAStartup: 一种只能取到IPv4,但是不需要WSAStartup: 如下: 方法一:(可以获取IPv4和I ...

  4. 【原】使用Bmob作为iOS后台开发心得——查询关联关系(BmobRelation)

    本文转载请注明出处 —— polobymulberry-博客园 简介 Bmob中的数据关联分为Pointer和Relation两种(数据关联在我开发app过程中使用还是很频繁的,也算个难点.虽然之前没 ...

  5. webService学习之路(二):springMVC集成CXF快速发布webService

    继上一篇webService入门之后,http://www.cnblogs.com/xiaochangwei/p/4969448.html ,现在我将我周六在家研究的结果公布出来 本次集成是基于之前已 ...

  6. C# 合并及拆分Word文档

    本文简要分析一下如何如何使用C#简单实现合并和拆分word文档.平时我们在处理多个word文档时,可能会想要将两个文档合并为一个,或者是将某个文档的一部分添加到另一个文档中,有的时候也会想要将文档拆分 ...

  7. J2EE 邮件发送那些事儿

    距离自己写的关于java邮件发送的第一篇博客已经有很长一段时间了,现在回过头看看.虽然代码质量方面有待提高,整体结构也不怎样,但是基本思路和过程还是比较纯的.现在有空写写J2EE中邮件发送的开发,实际 ...

  8. 安装完成后在命令行运行bash时报错0x80070057

    在命令运行bash 提示如下: 解决方法,不启用旧版本控制台: 右键命令提示栏 打开属性,把勾选去掉如下图红色边框标识: 然后重启,就可以使用,也包括可以打开Bash on Unbuntu on Wi ...

  9. python类的实例方法\静态方法\类方法区别解析(附代码)

    前言 搞了好久python,一直搞得不太清楚这几种类的方法,今天花时间好好测试一下,算是弄懂点皮毛吧. 三种方法的不同 先剽窃个图看一下 可以看到,实例是三种方法都可以调用的,而类只可以调用两种.所以 ...

  10. Vmware虚拟机安装Ubuntu并设置root登陆

    主机操作系统是win7.在Ubuntu官网下好系统镜像.iso文件,安装好Vmware workstation软件 1 安装Ubuntu系统到Vmware虚拟机: 注意下面这步是无法直接设置账号为ro ...