An identifier specifies the simple name of a database object, such as a column, table, index, or view, and are composed of a sequence of letters, digits, and underscores ( _ ) that represents it's name. Identifier names are obtained from the java class names and field names, but can be overwritten by extensions in the JDO MetaData. The below code, by default, will generate the table identifier "MY_CLASS", and the column identifier "MY_FIELD".
class MyClass
{
field myField;
...
}
The above generated identifiers are easily overwritten by the following metadata:
<class name="MyClass" identity-type="datastore">
<extension vendor-name="jpox" key="table-name" value="MyTable">
<field name="surname">
<extension vendor-name="jpox" key="column-name" value="MyColumn"/>
</field>
...
</class>
As result, using CaseIdentifier as PreserveCase, the table identifier is "MyTable" and the column identifier is "MyColumn". If the CaseIdentifier is UpperCase, then identifiers are "MYTABLE" and "MYCOLUMN".
Identifiers in JPOX are treated/transformed, by default, to uppercase, even those you have provided in the JDO MetaData, but they can be configured as:
The configuration for case in identifiers is to be done at PMF construction, by defining the following property:
org.jpox.store.Dictionary.CaseIdentifier=UpperCase|LowerCase|SentenceCase|CapitalizeCase|PreserveCase
Please be aware that some databases only support UpperCase identifiers and so setting this parameter may have no effect if your database doesn't support that option. |