Skip Headers

# Using the Command Line

Previous

Next

To create a new, mapped Oracle TopLink Workbench project from an XML schema using JAXB from the command line, use the `tljaxb.cmd` or `tljaxb.sh` file (located in the `<ORACLE_HOME>``/toplink/bin` directory) as follows:

1. Using a text editor, edit the `tljaxb.cmd` or `tljaxb.sh` file to set proxy settings (if required).

   If you are using a schema that imports another schema by URL and you are operating behind a proxy, then you must uncomment the lines shown in Example: Proxy Settings in tljaxb.cmd or Example: Proxy Settings in tljaxb.sh and edit them to set your proxy host (name or IP address) and port:

   Proxy Settings in tljaxb.cmd

       @REM set JVM_ARGS=%JVM_ARGS% -DproxySet=true -Dhttp.proxyHost= -Dhttp.proxyPort=

   Proxy Settings in tljaxb.sh

       # JVM_ARGS="${JVM_ARGS} -DproxySet=true -Dhttp.proxyHost= -Dhttp.proxyPort="

2. Execute the `tljaxb.cmd` or `tljaxb.sh` file (located in the `<ORACLE_HOME>``/toplink/bin` directory).

   The TopLink JAXB compiler generates JAXB-specific files (see "Understanding JAXB-Specific Generated Files") and TopLink-specific files (see "Understanding TopLink-Specific Generated Files").

   Example: Generating an Object Model from a Schema with tljaxb.cmd illustrates how to generate an object model from a schema using the Toplink JAXB compiler. Table: TopLink JAXB Binding Compiler Arguments lists the compiler arguments.

   Generating an Object Model from a Schema with tljaxb.cmd

       tljaxb.cmd -sourceDir ./app/src -generateWorkbench -workbenchDir ./app/mw  -schema purchaseOrder.xsd -targetPkg examples.ox.model.if -implClassPkg examples.ox.model.impl

   TopLink JAXB Binding Compiler Arguments

   Argument | Description | Optional?
   --- | --- | ---
   `-help` | Prints this usage information. | Yes
   `-version` | Prints the release version of the TopLink JAXB compiler. | Yes
   `-sourceDir` | The path to the directory into which generated interfaces, implementation classes, and deployment files are written. Default: directory named `source` in the specified output directory. | Yes
   `-generateWorkbench` | Generate a TopLink Workbench project and necessary project files. If omitted, only runtime information is generated. | Yes
   `-workbenchDir` | The path to the directory into which the TopLink Workbench project files are written. This argument requires the `-generateWorkbench` argument. Default: directory named `mw` in the specified output directory. | Yes
   `-schema` | The fully qualified path to your XSD file. | No
   `-targetPkg` | The name of the package to which both generated interfaces and classes belong. This defines your context path. To specify a different package for implementation classes, set the `-implClassPkg` argument. Default: a package name of `jaxbderived.<schema name>` where `<schema name>` is the name of the schema specified by the `-schema` argument. | Yes
   `-implClassPkg` | The name of the package to which generated implementation classes belong. If this option is set, interfaces belong to the package specified by the `-targetPkg` argument. This defines your context path. | Yes
   `-interface` | Generate only interfaces. This argument is optional. Default: generate both interfaces and implementation classes. | Yes
   `-verbose` | The interfaces and classes generated. This argument is optional. Default: not verbose. | Yes
   `-customize` | The fully qualified path and file name of a standard JAXB customization file that you can use to override default JAXB compiler behavior. | Yes

3. Optionally, open the generated TopLink Workbench project (see "TopLink Workbench Project") in TopLink Workbench, customize the generated mappings and descriptors, and reexport the TopLink project XML.

   Note: Before you compile your generated classes, be sure to configure your IDE classpath to include `<``ORACLE_HOME``>\lib\xml.jar`. For example, see Using an Integrated Development Environment.