This Document Provides Answers to Frequently Asked Questions About:
What is Java Dictionary?
SAP Web Application Server (SAP Web AS) provides the Java Dictionary framework for managing database objects and application-wide data types. Rather than using the proprietary tools of a DBMS vendor, you simply edit the database objects in the Dictionary perspective of the SAP NetWeaver Developer Studio. Once defined, your database objects work immediately on your favorite DBMS platform (supported by SAP Web AS).
You get the most out of the Java Dictionary technology if you apply it in conjunction with the SAP NetWeaver Development Infrastucture (NWDI).
Are there data types in Java Dictionary?
Yes. Java Dictionary provides portable data types. There are two kinds of them:
Please refer to the Java Persistence documentation for detailed information about working with data types in Open SQL for Java.
Where are the JDBC types in the table editor of Java Dictionary?
Actually, in Java Dictionary you do not work with JDBC types. Rather, you work with pre-defined types called built-in types (for example, ”integer,” "float,” “timestamp,” “string”). The built-in types map to the standard JDBC types.
Why is this indirection necessary? Well, for example, there are some differences in the semantics of the JDBC types across the supported DBMS. The built-in types eliminate this drawback: They are proven to behave identical on each supported DBMS platform. Your data domain is ready to run immediately on each supported DBMS.
As I have read in the documentation, Open SQL for Java defines the default mapping between Java Dictionary build-in data types and JDBC data types. If so, why does Java Dictionary define its own types instead of working with JDBC types directly?
First, there are some differences in the semantics of the JDBC types across the supported DBMS. An example here is the handling of strings independent of their length (JDBC types VARCHAR, LONGVARCHAR, CLOB). In contrast, Java Dictionary strings are proven to behave equally on whole supported platforms.
Second, Java Dictionary types minimize the TCO of your system, as they make the data type definition durable over a long time period. Java Dictionary types remain valid even if the JDBC types vary in future JDBC versions. Good news: Not you, but rather the Java Dictionary framework, takes care of the proper type conversion.
Third, let us point at the advantage of the built-in data types in a context of a whole application development. Java Dictionary projects are intended to centrally define application-wide data types that could be used in other project types, for example in Web Dynpro projects. Note that the built-in types free Web Dynpro developers - intended to be experts in the UI design area - of learning all the details about the database-related JDBC types. For example, you can simply apply the built-in type “string” for a character string instead of racking your brain for which JDBC type - VARCHAR, LONGVARCHAR, CLOB - is appropriate!
Can I generate Java Dictionary descriptions for existing tables that were not created with Java Dictionary?
SAP Web AS 6.40: No. This feature request has been listed in the requirements for the SAP Web AS.
Can I create additional indexes for Java Dictionary tables “on the fly” - at runtime, in the target database system, using proprietary database tools? Or, do I have to create them in the Java Dictionary editor and redeploy the tables?
You can create additional indexes directly in the database. Better, you can also adjust the corresponding Java Dictionary project so further system installations benefit in a straightforward way from the knowledge gained that creating an index is advantageous in this use case.
Java Dictionary: How can I create a unique index? (Is this what selecting the Key checkbox does?)
Selecting a Key checkbox for a table field results in adding the field to the primary key of the table. According to the primary key definition, a unique primary index will be created in the database implicitly.
Obviously, you can define additional unique indexes, namely in the tab 'Indexes' in a table editor of Java Dictionary (select the 'unique' checkbox for the index).
Does Java Dictionary support foreign key constraints? Is there a way to enforce referential integrity between tables?
No. Admittedly, you can set the foreign key constraints for your data domain if you model it with EJB entity beans with Container-Managed Persistence (EJB CMP). Please take into account that setting the foreign key constraints can impact the system’s performance.
Can I define authorization restrictions in the Java Dictionary editor – for example: “Only selected users are allowed to edit tables”?
The authorization restrictions, comparable to those available in the ABAP Dictionary, are not available in the Java Dictionary in SAP Web AS 6.40.
I want to save my table definition, but the “Save” button is not active. How can I save my work?
SAP Web AS 6.40: In the scope of a Java Dictionary project please use the “Save All Metadata” button to save the project contents.
I design Java Dictionary tables and types as parts of the node “Local Dictionary.” Are there other dictionaries?
Within the scope of Web Dynpro for Java projects, if you use the adaptive RFC technology, there are data types derived from ABAP Dictionary available as read-only.
Can I deploy a Java Dictionary table along with the table content?
Yes. You can deliver the Java Dictionary table along the table content. There are two possibilities:
Note that there is no modification support for table entries that are delivered in this way. Therefore, you can deliver table entries with program character or for examples, but not for templates or customizing data.
Does Java Dictionary support multilingual data?
Yes. In the scope of Web Dynpro projects, you can mark a field as “translatable.” The procedure is comparable to that of the ABAP Dictionary.
Can I define views in Java Dictionary?
Not in SAP Web AS 6.40. The next release will support defining views.
How can I delete or rename a table in Java Dictionary?
Deleting a table:
To delete a table, simply delete it in the Dictionary project. Don’t forget to rebuild and redeploy the archive: In doing so, you drop the real database table in the database.
The fine print: If you use Java Dictionary in conjunction with NWDI, you cannot reuse names of deleted database tables.
Renaming a table:
Java Dictionary does not support renaming tables. (Actually, it is hard to imagine a case when you need to rename a database table.)
How can I modify a table definition? Which modification operations are available?
In general, you can modify table definitions directly in the SAP NetWeaver Developer Studio.
If affected tables already exist in the database, don’t forget to generate the archive again and to redeploy it to modify the definition of the actual table. The result of the deployment is DBMS-dependent. Namely, at deployment, Java Dictionary first checks if the underlying DMBS can execute the required modification in a straightforward way:
This means that the available range of modifications is DBMS-specific. Moreover, the impact of a specific operation can be different among different DBMS's.
Can I view the content of a database table from the SAP NetWeaver Developer Studio?
There is nothing like a SE16 (of ABAP) in Java.