As3+java+mysql (MyBatis) Data automation tool (IV)

Source: Internet
Author: User

Now introduce the only configuration AS3 and Java Common Data class, this configuration is generally the data class only need to convert between AS3 and Java, and the database is not related. For example, in the data exchange between client and server, we need to define a uniform return request data Class Resultvo, containing an attribute result (bool) to indicate whether the request was successful, and the other property is data (object) that represents the return of the request. It is clear that the data class is not related to the database, if the configuration described in the previous article will generate redundant table data, and some data types are not well supported.

This data class can be configured with a different configuration, the configuration described in the previous article is very similar, just a few database related configuration, configuration format as follows:

<Objects>    <Objectname= "Resultvo"Note= "Request return Data"author= "Idoublewei">        <Fieldname= "Success"type= "bool"value= "false"Note= "Request is successful"/>        <Fieldname= "Data"type= "Object" value= "NULL "Note= "Request return Data"/>    </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

---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 representation of strings

------integer representing integers

------unsigned represents nonnegative integers

------Decimal means decimal

------BOOL Represents a Boolean value

------Date

------array to represent arrays

---value represents the default value for the Data class property and can not be specified

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

------If type is an array, you can take a value: New-New object, can be followed by the symbol "|" + element type (default is Object), for example-array| Integer

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

Therefore, when configuring the property type to be a custom type, it is best to write the package name of the type.

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.