As3+java+mysql (MyBatis) Data Automation tool (III)

Source: Internet
Author: User

Introduce the data class configuration, which is mainly used for data classes that need to convert the database MySQL data into Java objects and then convert them to AS3 objects.

The configuration file is in XML format.

<Objects>    <Objectname= "Tuservo"TableName= "V_user"Note= "comment"author= "Idoublewei">        <Fieldname= "id"type= "integer"Restrict= "PRIMARY Key"value= "0"Note= "Identity"/>        <Fieldname= "Name"type= "String|32"Restrict= "NOT NULL"value=""Note= "nickname"/>    </Object></Objects>

There can be only one root node objects in the configuration, each child node object represents a data class, and each child node of Object field represents a property of the data class

Object:

---name represents the data class name, you must specify

---tableName represents the generated MySQL corresponding table name, and if you do not specify this property, name is used as the table name

---Note data class comment, you can not specify

---Author data class Creator, you can not specify

Field:

---name represents the property name of the data class, you must specify

---type represents the Data class property type and must be specified (case sensitive)

------string to represent strings, followed by the symbol "|" + number, which represents the length of the string, for example-string|32, followed by the symbol "|text", indicating that the database uses the text type

------integer representing integers

------unsigned represents nonnegative integers

------Decimal means decimal

------BOOL Represents a Boolean value

------Date

---Restrict represents a database field constraint and is output as-is, you can not specify

---value represents the default value for the Data class property (the database defaults to null), and you can not specify

------If type is bool, you can only take a value: true, False

------If type is date, you can take a value: New-New object, MS-date millisecond number, followed by symbol "|" + number, for example-ms|428,format-date string, followed by symbol "|" + Date format character, for example-format|14- 04-16 20:15:36 637

---Note data class Property comments, you can not specify

It is important to note that when specifying a data class property type, if the specified type is not in the list of supported types, it is output as-is, such as a configuration property of

<name= "attr"  type= "Com.vo.MyClass"  value= "null "/>

The output is

---as3:var attr:com.vo.MyClass = null;

---java:com.vo.MyClass attr = null;

---mysql:attr com.vo.MyClass null,

Related Article

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.