PK
i\Eoa, mimetypeapplication/epub+zipPK i\E iTunesMetadata.plistw
EJBGen is an Enterprise JavaBeans 2.x code generator. If you annotate your Bean class file with JDK 1.5 annotations, you can use EJBGen to generate the Remote and Home classes and the deployment descriptor files for an EJB application.
Oracle recommends that you use EJBGen to generate deployment descriptors; this Oracle best practice allows for easier and simpler maintenance of EJBs. If you use EJBGen, you need to write and annotate only one bean class file, which simplifies writing, debugging, and maintenance. The following sections provide instructions on using EJBGen and define EJBGen command options and annotations:
These sections describe how to process an annotated bean file using EJBGen:
In this release of WebLogic Server, EJBGen and associated classes are included in weblogic.jar
in the WL_HOME/server/lib
of the WebLogic Server distribution. To use EJBGen, make sure weblogic.jar
is in your CLASSPATH. EJBGen annotations can be found in the weblogic.ejbgen
package.
If you have installed Oracle WebLogic Server examples, see WL_HOME\samples\server\examples\src\examples\ejb\ejb20\ and WL_HOME\samples\server\examples\src\examples\ejb\ejb21\
for an application that uses EJBGen.
Use this command to run EJBGen on a bean source file:
com.bea.wls.ejbgen.EJBGen
Note: To run this command, |
If you are invoking EJBGen for an EJB that has relationships with other EJBs, invoke the related EJBs by naming them, following your EJB, in the invocation, as follows:
com.bea.wls.ejbgen.EJBGen (YourBean).java (RelatedBean).java
Note: You can also invoke EJBGen via the |
Table E-1 defines EJBGen command options.
Table E-1 EJBGen Command Options
Option | Default | Definition |
---|---|---|
|
N/A |
If invoked with this option, EJBGen will not generate any classes but will search the classes supplied on the command line for tags that are not valid EJBGen tags. |
|
N/A |
Specifies the directory where the class loader can find dependent classes that are in .class format. To specify more than one class path, separate paths with a semicolon (;).For instance: If dependent classes are in .java format, use |
|
N/A |
The directory under which all the files will be created. |
|
0 |
Tells the compiler to generate only the deployment descriptor files. |
|
N/A |
The directory under which all the descriptor files will be created, relative to the output directory specified with the |
|
N/A |
If specified, EJBGen prints out the detailed documentation for this tag, including all the recognized attributes. Note that even though this option does not need any source file, you still need to specify an existing |
|
N/A |
Print out all the tags known by EJBGen. Note that even though this option does not need any source file, you still need to specify an existing |
|
N/A |
Same as |
|
" " |
The prefix to use when generating the EJB class. |
|
Bean or EJB |
The suffix to use when generating the EJB class. |
|
N/A |
Make EJBGen less verbose. |
|
N/A |
Verbose mode. |
|
N/A |
The path of the file where errors will be redirected. |
|
N/A |
EJBGen should exit in case of an error. |
|
N/A |
The base class for home remote interfaces. |
|
N/A |
The directory where to extract the templates. |
|
N/A |
Force the generation of all files regardless of time stamps. |
|
N/A |
The base class for home remote interfaces. |
|
N/A |
If this flag is set, EJBGen ignores the package name of the Java files it generates and creates those in the output directory as specified by the -d flag (or in the current directory if no -d was specified). |
|
" " |
The prefix to use for |
|
" " |
The suffix to use for |
|
N/A |
The base class for local interfaces. |
|
N/A |
The base class for local home interfaces. |
|
" " |
The prefix to use when generating the local EJB class. |
|
LocalHome |
The suffix to use when generating the local EJB class. |
|
" " |
The prefix to use when generating the local EJB class. |
|
" " |
The suffix to use when generating the local EJB class. |
|
0 |
The compiler does not generate the deployment descriptor files. |
|
false |
Disable propagation of java imports to generated classes. |
|
N/A |
If specified, local interfaces are not generated. |
|
N/A |
Cancels all redirection performed by EJBGen. |
|
N/A |
If specified, remote interfaces are not generated. |
|
N/A |
The path of the file where notices will be redirected. |
|
N/A |
If specified, value classes will not be generated. |
|
N/A |
The base class for generated primary keys. |
|
N/A |
Prints a diagnostic of all the tags found by EJBGen |
|
N/A |
Display all the tags recognized by EJBGen |
|
N/A |
The name of a property file that EJBGen reads to define substitution variables. See Using Property Files with EJBGen. |
|
N/A |
The base class for remote interfaces. |
|
" " |
The prefix to use when generating the remote EJB home class. |
|
" " |
The suffix to use when generating the remote EJB home class. |
|
" " |
The prefix to use when generating the remote EJB class. |
|
" " |
The suffix to use when generating the remote EJB class. |
|
1.5 |
Version of the JDK to use. |
|
N/A |
Specifies the directory where the class loader can find dependent classes that are in .java format. To specify more than one source path, separate paths with a semicolon (;).For instance: If dependent classes are in .class format, use |
|
N/A |
The directory where the templates are stored. |
|
N/A |
If specified, the |
|
N/A |
The base class of the value class generated by EJBGen. |
|
N/A |
The prefix to use when generating the value object class. |
|
N/A |
The suffix to use when generating the value object class. |
|
N/A |
Package the value classes belong to. |
|
false |
Display more information. |
|
N/A |
Display the help in Oracle Workshop for WebLogic Platform HTML format. |
|
N/A |
The encoding to use when generating XML files (default: UTF-8). |
These sections describe key EJBGen features and how to use them:
By default, EJBGen generates the following files:
Remote bean and home interfaces (if weblogic.ejbgen.JndiName with "remote" was specified)
Local bean and home interfaces (if weblogic.ejbgen.JndiName with "local" was specified)
Value object classes
Primary key classes (if applicable)
You can selectively disable the generation of these files by using the weblogic.ejbgen.FileGeneration
tag. This can be done on a per-bean basis.