JEECG-Java-based Intelligent development Framework for code generators second: code generator using rules __ frames

Source: Internet
Author: User
Tags generator

JEECG[J2EE Code Generation] is an agile development framework based on the coding generator.

Continued before: http://blog.csdn.net/zhangdaiscott/article/details/8272255


Chapter Topics: Code Builder Usage Rules


[A]. Standard for table Building

[1]. The table must have a unique primary key: Obid (character type 36-bit)

Note: The primary key is generated by the UUID method

[2]. Table Required fields (creator, creation time, etc...) )

[3]. A table field must have a comment

Note: The JSP page field text is generated based on the comment for the table segment

[4]. The Foreign key field names of the primary table and the child table must be the same (except the primary key Obid)

[5]. child table Reference Primary table primary key Obid as foreign key, foreign key field must end with Obid

Note: Follow the build template to create a new table with fields in the Template table that the builder will filter not to page generation

To build a table template:

Field name

Type

Length

Note

Primary key

Obid

varchar

36

Primary key

Ture

Other fields ...

Crtuser

varchar

36

Create a person

Crtuser_name

varchar

32

Create person Name

Create_dt

Datetime

0

Creation time

MODIFIER

varchar

36

Modify Person

Modifier_name

varchar

32

Modify Person Name

Modify_dt

Datetime

0

Modified Time

Delflag

Int

2

Delete tag

Del_dt

Datetime

0

Delete Time

[II]. Page Generation rules

The text content of the 0.JSP page field, and the first 6 characters of the comment for the table fields (if the table field annotation is blank, the page character Che Wen will be empty)

A. The first four fields of the JSP page that are generated by default must be entries, others must be input (manual addition required)

B. The database field type is: datetime--> corresponding page field, automatically append [month to day-time minutes] Time control

C. Database field type is: Date--> corresponding page will field, automatically append [month day] Time control

D. The database field type is:int/number--> the corresponding page field, the digital checksum is automatically appended (decimal numbers are not allowed)

E. The database field type is:float/double/decimal--> corresponding page page field, will automatically append a digital checksum (allow decimal to be entered)

[III]. Code generator Tool Class

A. single Table Model tool class: Com.test.CodeUtil

Code Generator Interface:

A. Dynamic selection needs to generate files (servicei\serviceimpl\jsp\action\entity\page)

B. Dynamic selection of JSP templates (two page styles: Row Edit/Detail page edit)


A-1. Detailed page edit page style:


A-2. Line edit Page Style


B. One-to-many model (Parent-child table) tool class: Generated page details can dynamically add rows

Com.test.codeonetomainutil[a pair of many additions and deletions to change the search]


To generate a page instance:

Omitted.. (See VIDEO)


Google code:http://code.google.com/p/jeecg/

QQ Exchange Group: 106838471

Contact Email: zhangdaiscott@163.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.