JPOX
JPOX
 JPOX Version 1.0
Configuration | Tutorials | Worked Examples | Developer
Obtaining JPOX
JPOX Preparation
JPOX Runtime
Identifiers

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".

Case

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:

  • UpperCase: identifiers are in upper case
  • LowerCase: identifiers are in lower case
  • SentenceCase: only the first letter of the identifier is in upper case, other are in lower case.
  • CapitalizeCase: each word first letter is in upper case, others are in lower case.
  • PreserveCase: No case changes are made to the name of the identifier provided by the user (class name or jdo metadata).

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.