As3 + java + mysql (mybatis) Automatic Data Tool (7)

Source: Internet
Author: User

Autoscript packed file address: http://pan.baidu.com/s/1dDvgcO5

If you need the project source code, you can leave an email address and declare that the tool is mainly used to automatically synchronize and output code files. Therefore, the Code is not very standardized, it does not have much reference significance, mainly because of the practicality of the tool.

The configuration of data classes and constants is basically the ones described above. Now let's talk about how to execute the configuration file. To execute the configuration file, you need to write a batch file in the following format:

java -classpath ./lib/*; AutoScript -?

This is a standard statement for executing java programs. Of course, you need to set the java environment variable before executing the command.

The classpath parameter specifies the package dependency required to execute the java class. AutoScript refers to the java class to be executed, and the final parameter is required by the AutoScript script class. The parameter value is:

-? : Indicates help. It outputs parameters that can be received by AutoScript, or it can be replaced by-help. If this parameter is set, other parameters are ignored.

-Module: indicates the functional modules to be executed. The valid parameters are-module macro (indicating the output constant) and-module object (indicating the output java and as3 public data classes ), -module database (indicating the output of java and as3 public data classes and mysql table creation scripts)

-Template: the path of the output file template required by freemaker, that is, the templates folder under the packed folder.

-Config: indicates the path of the configuration file of the relevant functional module. The macro function module can only receive one configuration file path. The object and database function modules can receive multiple configuration file paths.

-Javaoutput: Specifies the output directory of a java file, which can be a relative or absolute path. If this parameter is not specified, no java-related files are output.

-Javapackage: indicates the package name of a java class file.

-As3output: the output directory of as3 files. It can be specified as a relative path or an absolute path. If this parameter is not specified, no as3 files are output.

-Javapackage: indicates the package name of a java class file.

-As3alias: name of the ing File class between as3 and java data class

-Databaseoutput: mysql script file output directory. If this parameter is not specified, mysql-related files are not output.

-Databasename: mysql script file database name

 

Each Command has a fixed format: java-classpath./lib/*; AutoScript-template./templates/-module xxx

Function module-module macro requires subsequent parameters-config xxx-javaoutput xxx-javapackage xxx-as3output xxx-as3package xxx, where the-config parameter is required

Function module-module object requires subsequent parameters-config xxx-javaoutput xxx-javapackage xxx-as3output xxx-as3package xxx-as3alias xxx, where the-config parameter is required

Function module-Subsequent parameters are required for module database-Config xxx-javaoutput xxx-javapackage xxx-as3output xxx-as3package xxx-as3alias xxx-databaseoutput xxx-databasename xxx, where the-config parameter is required

 

It should be noted that it is best to use a batch when outputting data classes. The-config parameter specifies all data class configuration files so that-as3alias only generates one file. During client initialization, you only need to call the data class ing class once. However, the ing between the function module object and the data class output by the database cannot be output to an as3alias ing Class. Therefore, it is recommended that the value of the-as3alias parameter in the object function module and the database function module be the same.

 

After that, you may still have some questions. The following describes the execute_sample.bat script in the packed folder.

 

: Print the commands supported by AutoScript java-classpath./lib/*; AutoScript -?

View the parameters supported by AutoScript,

 

: Output macro file java-classpath. /lib/*; AutoScript-template. /templates/^-module macro ^-config. /samples/macrosample. xml ^-javaoutput. /output/java/com/vo/^-javapackage com. vo ^-as3output. /output/as3/com/vo/^-as3package com. vo

 

 

 Output the constant configuration file macrosample. xml in the packed/samples folder (the ^ symbol at the end of each line is the Escape Character connecting two lines in the windows batch file)

-The module specifies the output constant function module.

-The config parameter specifies the macrosample. xml file under the constant configuration file samples directory.

-Javaoutput specifies the directory of the output java constant class file as output/java/com/vo/In the packed folder/

-Javapackage specifies the package path of the java constant class.

-As3output specifies the directory for the output as3 constant class file to be output/as3/com/vo/In the packed folder/

-As3package specifies the package path of the as3 constant class.

Output file directory

 

 

: Output class file java-classpath. /lib/*; AutoScript-template. /templates/^-module object ^-config. /samples/objectsSample. xml. /samples/objectsSample2.xml ^-javaoutput. /output/java/com/vo/^-javapackage com. vo ^-as3output. /output/as3/com/vo/^-as3package com. vo ^-as3alias AliasRegister

 

Output packed/SamplesObjectsSample. xml and objectsSample2.xml in the folder.

-Module: Specifies the synchronization function modules of the output as3 and java data classes.

-Config specifies two data class configuration files: objectsSample. xml and objectsSample2.xml.

-As3alias specifies the as3 and java data class ing class, which is used by the client and needs to be called during client initialization. register (), so that the object obtained from the server can be converted to the corresponding as3 object

Package com. vo {import flash.net. registerClassAlias; /*** register the object class corresponding to the backend * 17:56:25 */public class AliasRegister {// ============ ========================================================== ==============================/// PROPERTY // ============================ ========================================================== ================================/** whether or not registered */private static var $ registered: boolean = false; // ================================================ ==================================================================== // PUBLIC // =================================================== ===================================================/ ** register an alias */public static function register (): void {if ($ registered) return; $ registered = true; registerClassAlias ("com. vo. TUserVO ", com. vo. TUserVO );}}}

 

Other parameters are the same as those in the output file directory.

 

: Output the database script file java-classpath. /lib/*; AutoScript-template. /templates/^-module database ^-config. /samples/databaseSample. xml ^-javaoutput. /output/java/com/vo/^-javapackage com. vo ^-as3output. /output/as3/com/vo/^-as3package com. vo ^-as3alias AliasRegister ^-databaseoutput. /output/java/com/vo/^-databasename mysql_database

 

Output packed/SamplesDatabaseSample. xml in the folder.

-Module specifies the synchronization function modules of the output as3, java, and mysql scripts.

-Databaseoutput: Specify the mysql Script output to packed/output/java/com/vo /.

-Databasename specifies the mysql database name and the script file name is mysql_database

Output directory

 

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.