As3+java+mysql (mybatis) Data Auto Tool (vii)-end

Source: Internet
Author: User

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

If you need the project source, you can leave the mailbox, the first statement, the tool is mainly to achieve automatic synchronization output code class file function, so the code is not very normative what, not much reference significance, the main tool is practical.

The configuration of the data classes and constants is basically what is described earlier, and now is how to execute the configuration file. Executing a configuration file requires writing a batch file with the following format

Java-classpath./lib/*; Autoscript-?

This is a standard execution of Java program statements, of course, before executing the command is necessary to set up the Java environment variables.

The CLASSPATH parameter specifies the package dependencies required to execute the Java class, autoscript refers to the Java class that needs to be executed, and finally the parameters required by the Autoscript script class, with the values of:

-? : Indicates help, output autoscript can receive parameters, can also be replaced with-help, when there is this parameter, will ignore other parameters

-module: Indicates what function module needs to be executed, valid parameters are-module macro (representing output constants),-module object (representing output Java and AS3 Common data Class),-module database (representing output Java and AS3 Common data classes, and MySQL's Build table scripts)

-template:freemaker required output file template path, which is the Templates folder under the packed folder

-config: Indicates the configuration file path of the relevant function module, the macro function module can only receive one profile path, and the object and database function module may receive multiple configuration file paths

-javaoutput: Represents the output directory of a Java class file, which can be specified as a relative or absolute path. If you do not specify this parameter, Java-related files are not exported

-javapackage: Represents the package name of a Java class file

-as3output: Represents the output directory of the AS3 class file, either as a relative path or an absolute path. If this parameter is not specified, the AS3 related file is not output

-javapackage: Represents the package name of a Java class file

Mapping file class names for-AS3ALIAS:AS3 and Java data classes

-databaseoutput:mysql script file output directory. If you do not specify this parameter, the database MySQL-related files are not exported

-databasename:mysql script File Database name

Each execution 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 xxx-javaoutput xxx-javapackage xxx-as3output xxx-as3package xxx-as3alias xxx, its The-config parameter is required

Function Module-module database requires subsequent parameters -config xxx xxx-javaoutput xxx-javapackage xxx-as3output xxx-as3package Xxx-as3alias Xxx-databaseoutput xxx-databasename xxx, where the-config parameter is required

It is important to note that the output data class is best used in a batch, the-config parameter specifies all data class configuration files, so that the-as3alias is only used to generate one, when the client initializes, it is only used to call the data class of the mapping class. However, the mapping of the data class of the function module object and database output is not able to output to a As3alias mapping class, so the-as3alias parameter values in the Object function module and the database function module should not be the same.

Said, may still some do not understand, the following description of the packed folder under the Execute_sample.bat script bar.

:: print Autoscript supported commands java-classpath./lib/*; Autoscript-?

View the parameters supported by Autoscript,

:: output macro file Java-classpath./lib/*;  ./templates/./samples/macrossample.  ./output/java/com/vo/ ^-javapackage com.  ./output/as3/com/vo/ ^-as3package com. Vo

constant profile macrossample.xml under Output Packed/samples folder (the ^ symbol at the end of each line is the escape character that connects 2 lines in the Windows batch file)

-MODULE Specifies the output constant function module

The-config parameter specifies the Macrossample.xml file in the Samples directory of the constant configuration file

-JAVAOUTPUT specifies that the output Java constant class file directory is output/java/com/vo/under the packed folder

-JAVAPACKAGE Specifies the package path for the Java constant class

-AS3OUTPUT specifies that the output AS3 constant class file directory is output/as3/com/vo/under 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 ^  ./samples/objectssample.xml./samples/objectssample2.  ./output/java/com/vo/ ^-javapackage com.  ./output/as3/com/vo/ ^-as3package com. vo ^-as3alias aliasregister

Output packed objectssample.xml and objectssample2.xml under the/samples folder.

-module specifying output AS3 and Java Data class synchronization function modules

-CONFIG specifies two data class profiles Objectssample.xml and Objectssample2.xml

-AS3ALIAS Specifies the AS3 and Java Data class mapping classes, which are used by clients to invoke Aliasregister.register () on client initialization so that objects obtained from the server can be converted to corresponding AS3 objects

Package com.vo{ImportFlash.net.registerClassAlias; /** * Register the entity class corresponding to the backend * 2014-05-24 17:56:25*/     Public classAliasregister {//============================================================================        // Property        //============================================================================        /** is registered*/        Private Static var$registered:Boolean=false; //============================================================================        // Public        //============================================================================        /** Register Aliases*/         Public Static functionRegister ():void        {            if($registered)return; $registered=true; Registerclassalias ("Com.vo.TUserVO", Com.vo.TUserVO); }            }}

Other parameters, output file directory

:: Output Database script file java-classpath./lib/*; autoscript-template./templates/^-module Database ^  ./samples/databasesample.  ./output/java/com/vo/ ^-javapackage com.  ./output/as3/com/vo/ ^-as3package com.  ./output/java/com/vo/ ^-databasename mysql_database

Output packed the databasesample.xml under the/samples folder.

-MODULE Specifies the output AS3, Java, and MySQL script synchronization function modules

-databaseoutput specifying the MySQL script output to packed/output/java/com/vo/

-DATABASENAME Specifies the MySQL database name, and the script file is named Mysql_database

Output Directory

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.