This is [challenging the MVC limit] The second article in the series of preemptible EasyJWeb-1.0 featuresArticleToday, through a spring2 + JPA (hibernate3.2) +EasyjwebThe example of deleting, modifying, and querying allows you to quickly enter the easyjweb quick development experience in two minutes.
Easyjweb is an open-source project. Let's first look at its related resources:
Official Website:Http://www.easyjf.com/easyjweb
Easyjweb collaborative development source code library SVN: http://svn.easyjf.com/repository/easyjf/easyjweb/trunk
Easyjweb source code HTTP download:Http://www.easyjf.com/easyjweb/download.htm
Follow these steps to go to Quick Start:
1. Download and decompress the latest source code;
2. Run bin/easyjweb crud D:/myppp on the command line.
3. Switch to the D:/mypp/bin directory and run the sample
4. PassHttp: // localost: 82/EJF/account/ListView the running effect.
The following is a brief introduction. After the easyjweb source code is obtained, the following directory structure will be mentioned after decompression:
Use the command line to switch to the bin directory and run the easyjweb crud D:/MyApp command. (If this is the first execution, if you only download the jar library on which easyjweb depends, you need to wait for a while, and the system will download the package on which easyjweb + spring2 + JPA applications depend ).
Wait a moment and you will see that a crud application directory based on easyjweb + spring2 + JPA is generated under the D:/MyApp directory. The directory structure of MyApp is roughly as follows:
Run the command line to enter the D:/mypp/bin directory. You can see the following directory structure:
The bin directory contains some scripts and commands provided by easyjweb quick development, including databases, web servers,CodeGenerate and sample applications.
Enter the sample directly, press enter to enter the easyjweb code generation example engine, execute code generation, compilation, release, run, and start the browser to view the results of the quick experience process. The following example shows how to add crud for an enterprise-level application based on easyjweb + JPA + spring. As shown in:
(Code generation prompt information)
(The running result is displayed in the browser automatically)
(Perform operations such as adding, deleting, modifying, and querying)
Application Generated by OperationProgram, We found that this skeleton application contains very practical operations such as adding, deleting, modifying, paging, sorting by attribute, and automatic verification on the server side.
Under the/src/main/Java directory of the project, you can view the generatedSource codeThe entity account. Java code is as follows:
(Source code of account. Java)
EasyJWeb-1.0 using Maven for continuous integration and development, you can use Maven as needed for specific build work. For example, the following command:
Maven compile to compile the current project
Maven jar: Compile the current project and release it as a jar package.
Maven war: Compile the current web application project and publish it as a war package
Based on maven, easyjweb provides some simplified command scripts to help you quickly get started with the project as needed:
Easyjweb blank D:/MyApp generates an empty easyjweb project, which only requires a very small number of jar files.
Easyjweb crud D:/mypp generates a project based on easyjweb + spring + JPA, including related code generation scripts, tools, and required jar.
Easyjweb curd:/MyApp-DBO generates a project based on easyjweb + easydbo, including code generation scripts, and generates crud applications based on easydbo.
In the generated crud application project, we can use the generator command under bin to generate various common code including addition, deletion, modification, and query. For example:
Description of generator entity-generate an application for deletion, modification, and query based on Entity description.
Generator domain domainfullname generates the add, delete, modify, and query application of this domain object based on the domainfullname domain object.