Generating Java source files
Generating Java source files
You generate Java source files from the classes and interfaces of a model. A separate file, with the file extension .java, is generated for each class or interface that you select from the model. You can only generate Java files from one model at a time.
You can compile the .java class files that you generate from an OOM in any Java compiler tool. You can also run Java in a database server such as Sybase Adaptive Server Anywhere. Using Sybase Adaptive Server Anywhere, you can call Java from SQL by calling Java functions (methods) from SQL statements. Java methods provide a more powerful language than SQL stored procedures for adding logic to the database.
You can use Java classes as data types. Every Java class installed in a database becomes available as a data type that can be used as the data type of a column in a table.
You can save Java objects in tables. An instance of a Java class (a Java object) can be saved as a value in a table. Java objects can be inserted into a table, SELECT statements can be executed against the fields and methods of objects stored in a table, and Java objects can be retrieved from a table.
Defining Java generation options
| You can set Java generation options to check a model for errors before |
| generating, or to sort the order in which the attributes and operations of the |
| class in a Java class definition file are displayed according to visibility or |
| type sort criteria. |
Check model | You can check the model before generation. The generation stops if an error |
| is found. |
Visibility sort | You can sort the order in which attributes and operations are arranged in the |
| code of the classes by the following criteria. |
Option
Public - Private
Private - Public
None
Result of selection
After generation, public attributes and operations are placed before private attributes and operations in the class definition
After generation, private attributes and operations are placed before public attributes and operations in the class definition
Attributes and operations order remains unchanged after generation