Appfuse: maintenance for the first table and maintenance for appfuse
1. Create a table userinfo
Column name |
Description |
UserID |
Primary Key, auto-Increment |
UserName |
User Name |
Pwd |
Password |
CreateDate |
Creation date |
2. Add the file hibernate. reveng. xml in the src/main/resources directory.
<? Xml version = "1.0" encoding = "UTF-8"?> <! DOCTYPE hibernate-reverse-engineering SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd"> 3. Open the command line and enter mvn appfuse: gen-model to generate the entity class userinfo. java.
Package com. zcmp. disappearwind. model; import com. zcmp. disappearwind. model. baseObject; import org. hibernate. search. annotations. entid; 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. gener AtedValue; 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 = "disappe Arwind ") @ Indexed @ XmlRootElementpublic class Userinfo extends BaseObject implements Serializable {private Long userId; private Date createDate; private String pwd; private String userName; @ Id @ GeneratedValue (strategy = IDENTITY) @ entid public Long getUserId () {return this. userId;} public void setUserId (Long userId) {this. userId = userId;} @ Temporal (TemporalType. TIMESTAMP) @ Column (name = "re AteDate ", 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. Run the mvn appfuse: gen generation page, Controller, menu configuration, and other files on the command number. Note that the case must be consistent with the class name generated in step 3 when the entity name is entered.
5. Open the ApplicationResources_zh.properties file, name of each field in Chinese, and various titles and prompts
6. Redeploy