Skip Headers
Dali Java Persistence Tools User Guide
Release 3.2
Release 3.2
  PDF
PDF
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Wizards
 
Next
Preferences
 

Property pages

This section includes information each property page in the following views:

JPA Details view (for entities)

The JPA Details view displays the persistence information for the currently selected entity and contains the following tabs:

Entity Type

Clicking the name of the mapping type, which is represented as a hyperlink, invokes the Mapping Type Selection dialog. Use this dialog to specify the type of entity: Mapped Superclass, Embeddable or the default mapping type.

Additional Information

Depending on the entity type, the following additional areas will be available:

Entity

This table lists the Entity information fields available in the JPA Details view for an Entity.

Property Description Default

Table

The default database table information for this entity. These fields can be overridden by the information in the Attribute Overrides area.


Name

The name of the primary database table associated with the entity.


Catalog

The database catalog that contains the Table.

As defined in orm.xml.

Schema

The database schema that contains the Table.

As defined in orm.xml.

Name

The name of this entity. By default, the class name is used as the entity name.


Access

Specify how the entity its access instance variables.

  • Property – Persistent state accessed through the property accessor methods. The property accessor methods must be public or private.

  • Field – Instance variables are accessed directly. All non-transient instance variables are persistent.

Note: This field is for display only, based on the properties in the orm.xml: If only the methods of the class are annotated, property access type is used. In all other cases, field access type is used.

Field

ID class

Click Browse and select the primary key for the entity. Clicking the field name, which is represented as a hyperlink, allows you to create a new class.



Related tasks

Related reference

Embeddable

This table lists the Embeddable information fields available in the JPA Details view for Embeddable entity type.

Property Description Default

Access

Specify how the entity its access instance variables.

  • Property – Persistent state accessed through the property accessor methods. The property accessor methods must be public or private.

  • Field – Instance variables are accessed directly. All non-transient instance variables are persistent.

Note: This field is for display only, based on the properties in the orm.xml: If only the methods of the class are annotated, property access type is used. In all other cases, field access type is used.

Field


Related tasks

Related reference

Mapped Superclass

This table lists the Embeddable information fields available in the JPA Details view for Mapped superclass entity type.

Property Description Default

Access

Specify how the entity its access instance variables.

  • Property – Persistent state accessed through the property accessor methods. The property accessor methods must be public or private.

  • Field – Instance variables are accessed directly. All non-transient instance variables are persistent.

Note: This field is for display only, based on the properties in the orm.xml: If only the methods of the class are annotated, property access type is used. In all other cases, field access type is used.

Field

ID class

Click Browse and select the primary key for the entity. Clicking the field name, which is represented as a hyperlink, allows you to create a new class.



Related tasks

Related reference

Caching

This table lists the Caching information fields available in the JPA Details view for each entity type.

Property Description Default Available for Entity Type

Cachable

Specifies if the entity is cachable.

This field corresponds to the @Cachable annotation.

True

Entity and Mapped superclass

Type

Select one of the following as the Default Cache Type:

  • Weak with Soft Subcache–This option is similar to Weak with Hard Subcache except that it maintains a most frequently used subcache that uses soft references. The size of the subcache is proportional to the size of the identity map. The subcache uses soft references to ensure that these objects are garbage-collected only if the system is low on memory.

    Use this identity map in most circumstances as a means to control memory used by the cache.

  • Weak with Hard Subcache–This option is similar to Soft with Weak subcache except that it maintains a most frequently used subcache that uses hard references. Use this identity map if soft references are not suitable for your platform.

  • Weak–This option is similar to Full, except that objects are referenced using weak references. This option uses less memory than Full, allows complete garbage collection and provides full caching and guaranteed identity.

    Use this identity map for transactions that, once started, stay on the server side.

  • Soft–This option is similar to Weak except that the map holds the objects using soft references. This identity map enables full garbage collection when memory is low. It provides full caching and guaranteed identity.

  • Full–This option provides full caching and guaranteed identity: all objects are cached and not removed.

    Note: This process may be memory-intensive when many objects are read.

  • None–This option does not preserve object identity and does not cache objects.This option is not recommended.

Weak with Soft Subcache

Entity and Mapped superclass

Size

Defines the size of cache to use (number of objects).

100

Entity and Mapped superclass

Advanced



Entity and Mapped superclass

Expiry

Enables the expiration of the cached instance after a fixed period of time (milliseconds). Queries executed against the cache after this will be forced back to the database for a refreshed copy.

No expiry

Entity and Mapped superclass

Always refresh

Specifies if all queries that go to the database should always refresh the cache.

False

Entity and Mapped superclass

Refresh only if newer

Specifies if all queries that go to the database should refresh the cache only if the data received from the database by a query is newer than the data in the cache (as determined by the optimistic locking field).

Notes:

  • This option only applies if one of the other refreshing options, such as alwaysRefresh, is already enabled.

  • A version field is necessary to apply this feature.

False

Entity and Mapped superclass

Disable hits

Specifies if all queries should bypass the cache for hits, but still resolve against the cache for identity. This forces all queries to hit the database.

False

Entity and Mapped superclass

Coordination type

Specify the cache coordination mode:

  • Send Object Changes

  • Invalidate Changed Objects

  • Send New Objects with Changes

  • None

Send Object Changes

Entity and Mapped superclass

Existence checking

Specify how Dali should check to determine if an entity is new or exists.

  • Check Cache – If the object's primary key does not include null and it is in the cache, then it must exist.

  • Check Cache then Database – Perform a "does exist check" on the database.

  • Assume Existence – If the object's primary key does not include null then it must exist. You may use this option if the application guarantees or does not care about the existence check.

  • Assume Non-existence – Assume that the object does not exist. You may use this option if the application guarantees or does not care about the existence check. This will always force an INSERT operation.

Check Cache then Database

Entity and Mapped superclass


Related reference

Queries

Use the queries area of the JPA Details view to create named queries and named native queries. Refer to "Creating queries" for additional information.

Property Description Default Available for Entity Type

Queries

Displays the existing Named and Native queries.

Click Add to add a named or named native query by using the Add Query dialog.


Entity and Mapped superclass

Named Queries




Name

Name of the query.


Entity and Mapped superclass

Query

The query SQL.


Entity and Mapped superclass

Lock mode

Specify the JPA locking policy.

  • None

  • Optimistic

  • Optimistic Force Increment

  • Pessimistic Force Increment

  • Pessimistic Read

  • Pessimistic Write

  • Read

  • Write

None

Entity and Mapped superclass

Native Queries




Name

Name of the query.


Entity and Mapped superclass

Result class

The class of the result.

Note: This field appears for Native Named Queries only.


Entity and Mapped superclass

Query

The query SQL.


Entity and Mapped superclass

Query hints

Displays the existing query hints (Name and Value).

Click Add to add a new query hint.


Entity and Mapped superclass


Related tasks

Related reference

Related concepts

Inheritance

This table lists the fields available on the Inheritance area in the JPA Details view for each entity type.

Property Description Default Available for Entity Type

Strategy

Specify the strategy to use when mapping a class or class hierarchy:

  • Single table – All classes in the hierarchy are mapped to a single table.

  • Joined – The root of the hierarchy is mapped to a single table; each child maps to its own table.

  • Table per class – Each class is mapped to a separate table.

This field corresponds to the @Inheritance annotation.

Single table

Entity


Discriminator Value

Specify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified Discriminator Type.


Entity


Discriminator Column

These fields are available when using a Single or Joined inheritance strategy.

This field corresponds to the @DiscriminatorColumn annotation.

Use the Details area to define the Length and Column definition of this Discriminator Column.



Name

Name of the discriminator column


Entity


Type

Set this field to set the discriminator type to Char or Integer (instead of its default: String). The Discriminator Value must conform to this type.

String

Entity


Length

The column length for String-based discriminator types.

0

Entity


Column definition

The SQL fragment that is used when generating the DDL for the discriminator column.


Entity


Primary Key Join Columns

Use to override the default primary key join columns. Select Override Default, then click Add to select new Join Column with the Add Primary Key Join Column dialog.

This field corresponds with @PrimaryKeyJoinColumn annotation.


Entity



Refer to "Specifying entity inheritance" for additional information.

Related tasks

Related reference

Attribute Overrides

Use the Attribute Overrides area in the JPA Details view to override the default settings specified in the Entity area of an attribute. Attribute overrides generally override/configure attributes that are inherited or embedded.

This table lists the Attribute override fields available in the JPA Details view for each entity type.

Property Description Default Available for Entity Type

Attribute Overrides

Specify a property or field to be overridden (from the default mappings). Select Override Default.


Entity


Join Columns



Entity



Related tasks

Related reference

Multitenancy

Use the Multitenancy area in the JPA Details view to specify that a given entity is shared among multiple tenants of an application.

Property Description Default Available for Entity Type

Multitenancy strategy

Specify the multitenant strategy to use:

  • Single table

  • Table per tenant

  • VPD

Single table

Entity and Mapped superclass

Include criteria

Specify if the database requires the tenant criteria to be added to the SELECT, UPDATE, and DELETE queries.

True

Entity and Mapped superclass

Tenant descriptor columns

Use to limit what a persistence context can access in single-table mulitenancy


Entity and Mapped superclass

Override default




Name

The name of column to be used for the tenant discriminator.

eclipselink.tenant-id


Table

The name of the table that contains the column.



Context property

The name of the context property to apply to the tenant discriminator column.



Discriminator type

The type of object/column to use as a class discriminator:

  • Character

  • Integer

  • String

String


Length

The column length for String-based discriminator types.



Column definition

The SQL fragment that is used when generating the DDL for the discriminator column.



Primary key

Specifies that the tenant discriminator column is part of the primary key of the tables.

False



Related reference

Primary Key Generation

Use the Primary Key Generation area in the JPA Details view to specify how to generate a primary key for a given entity.

Property Description Default Available for Entity Type

Table Generator

These fields define the database table used for generating the primary key and correspond to the @TableGenerator annotation.


Entity


Name

Unique name of the generator.


Entity


Table

Database table that stores the generated ID values.


Entity


Schema

Database schema of the Table.


Entity


Catalog

Database catalog of the Table.


Entity


Primary key column

The column in the table generator's Table that contains the primary key.


Entity


Value column

The column that stores the generated ID values.


Entity


Allocation size

The value for the Primary Key Column in the generator table.

50

Entity


Initial value

The starting value of the generated primary key.

0

Entity


Sequence Generator

These fields define the specific sequence used for generating the primary key and correspond to the @SequenceGenerator annotation.

These fields apply only when Strategy = Sequence.


Entity


Name

Name of the sequence table to use for defining primary key values.


Entity


Sequence

Unique name of the sequence.


Entity


Schema

Database schema of the Sequence.


Entity


Catalog

Database catalog of the Sequence.


Entity


Allocation size

These fields define the specific sequence used for generating the primary key and correspond to the @SequenceGenerator annotation.

These fields apply only when Strategy = Sequence.

50

Entity


Initial value

The starting value of the generated primary key.

1

Entity



Related reference

Secondary tables

Use the Secondary Tables area in the JPA Details view to associate additional tables with an entity. Use this area if the data associated with an entity is spread across multiple tables.

Refer to "Specifying additional tables" for additional information.

Related tasks

Related reference

Converters

Use the Converter area in the JPA Details view to specify a way to modify data value(s) during the reading and writing of a mapped attribute.

Property Description Default Available for Entity Type

Converters

Click Add and use the Add Converter dialog to create a new converter.

  • Object Type – converts a fixed number of database data value(s) to Java object value(s)

  • Type – modifies data values

  • Struct – Enable custom processing of java.sql.Struct types

  • Custom


Entity, Embeddable, and Mapped superclass

Name

The String name for your converter, must be unique across the persistence unit


Entity, Embeddable, and Mapped superclass

Class

The class of your converter. This class must implement the org.eclipse.persistence.mappings.converters.Converter interface.

Appears for Custom and Struct converters only.


Entity, Embeddable, and Mapped superclass

Data type

The type stored in the database.

Appears for Object Type and Type converters only.


Entity, Embeddable, and Mapped superclass

Object type

The type stored on the entity.

Appears for Object Type and Type converters only.


Entity, Embeddable, and Mapped superclass

Conversion values

The array of conversion values (instances of ConversionValue: String objectValue and String dataValue).

Appears for Object Type converters only.


Entity, Embeddable, and Mapped superclass

Default object value

Set the value of this attribute to the default object value. Note that this argument is for dealing with legacy data if the data value is missing.

Appears for Object Type converters only.


Entity, Embeddable, and Mapped superclass


Related reference

Advanced

Use the Advanced area in the JPA Details view to configure additional settings for an entity.

Property Description Default Available for Entity Type

Read-only

Specifies if a class is read-only.

False

Entity and Mapped superclass

Customizer class

Specifies a class that implements DescriptorCustomizer and is to run against an entity's class descriptor after all metadata processing has been completed.

True

Entity, Embeddable, and Mapped superclass

Change tracking

Specifies the ObjectChangePolicy to use:

  • Attribute – Objects with changed attributes will be processed in the commit process to include any changes in the results of the commit. Unchanged objects will be ignored.

  • Object – Changed objects will be processed in the commit process to include any changes in the results of the commit. Unchanged objects will be ignored.

  • Deferred – Defers all change detection to the UnitOfWork's change detection process.

  • Auto – Does not set any change tracking policy; change tracking will be determined at runtime.

Auto

Entity, Embeddable, and Mapped superclass


Related reference

JPA Details view (for attributes)

The JPA Details view displays the persistence information for the currently selected mapped attribute and contains the following areas:

Mapping Type

Additional Information

Depending on the mapping type, the following additional areas will be available:

Basic Mapping

Property Description Default

Column

The database column that contains the value for the attribute. This field corresponds to the @Column annotation.

By default, the Column is assumed to be named identically to the attribute and always included in the INSERT and UPDATE statements.

Name

The database column that contains the value for the attribute.


Table

Name of the database table that contains the selected column.


Details



Insertable

Specifies if the column is always included in SQL INSERT statements.

True

Updatable

Specifies if this column is always included in SQL UPDATE statements.

True

Unique

Sets the UNIQUE constraint for the column.

False

Nullable

Specifies if the column allows null values.

True

Length

Sets the column length.

255

Precision

Sets the precision for the column values.

0

Scale

Sets the number of digits that appear to the right of the decimal point.

0

Column definition

The SQL fragment that is used when generating the DDL for the column.


Fetch

Defines how data is loaded from the database:

  • Eager – Data is loaded in before it is actually needed.

  • Lazy – Data is loaded only when required by the transaction.

Eager

Optional

Specifies if this field is can be null.

True

Mutable

Specify if the value of a complex field type can be changed (or not changed) instead of being replaced.

True


Basic mappings also include the following areas:

Element Collection Mapping

Property Description Default

Target class

The class (basic or embeddable) that is the element type of the collection.


Fetch

Defines how data is loaded from the database:

  • Eager – Data is loaded in before it is actually needed.

  • Lazy – Data is loaded only when required by the transaction.

Lazy

Join fetch

The type of fetch to use:

  • Inner – Provides the inner join fetching of the related object.

    Note: Inner joining does not allow for null or empty values

  • Outer – Provides the outer join fetching of the related object

    Note: Outer joining allows for null or empty values.

None

Collection Table



Name

Name of the database table used for the mapping.


Schema

Database schema of the Collection Table.


Catalog

Database Catalog of the Collection Table.


Join Columns



Override default

Click Add to create a new join column, by using the Add Join Column dialog.

0


Element collection mappings also include the following areas:

Embedded Mapping

Embedded ID Mapping

ID Mapping

Property Description Default

Column

The database column that contains the value for the attribute. This field corresponds to the @Column annotation.

By default, the Column is assumed to be named identically to the attribute.

Name

The database column that contains the value for the attribute.


Table

Name of the database table that contains the selected column.


Details



Insertable

Specifies if the column is always included in SQL INSERT statements.

True

Updatable

Specifies if this column is always included in SQL UPDATE statements.

True

Unique

Sets the UNIQUE constraint for the column.

False

Nullable

Specifies if the column allows null values.

True

Length

Sets the column length.

255

Precision

Sets the precision for the column values.

0

Scale

Sets the number of digits that appear to the right of the decimal point.

0

Column definition

The SQL fragment that is used when generating the DDL for the column.


Mutable

Specify if the value of a complex field type can be changed (or not changed) instead of being replaced.

True


ID mappings also include the following areas:

Many-to-Many Mapping

Property Description Default

Target entity

The persistent entity to which the attribute is mapped.


Fetch

Defines how data is loaded from the database:

  • Eager – Data is loaded in before it is actually needed.

  • Lazy – Data is loaded only when required by the transaction.

Lazy

Join fetch

The type of fetch to use:

  • Inner – Provides the inner join fetching of the related object.

    Note: Inner joining does not allow for null or empty values

  • Outer – Provides the outer join fetching of the related object

    Note: Outer joining allows for null or empty values.

None

Cascade

Specify which operations are propagated throughout the entity.

  • All – All operations

  • Persist

  • Merge

  • Move

  • Remove

  • Refresh

True


One-to-many mappings also include the following areas:

Many-to-One Mapping

Property Description Default

Target entity

The persistent entity to which the attribute is mapped.

You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.

null

Fetch

Defines how data is loaded from the database:

  • Eager – Data is loaded in before it is actually needed.

  • Lazy – Data is loaded only when required by the transaction.

Lazy

Join fetch

The type of fetch to use:

  • Inner – Provides the inner join fetching of the related object.

    Note: Inner joining does not allow for null or empty values

  • Outer – Provides the outer join fetching of the related object

    Note: Outer joining allows for null or empty values.


Optional

Specifies if this field is can be null.

True

Cascade

Specify which operations are propagated throughout the entity.

  • All – All operations

  • Persist

  • Merge

  • Move

  • Remove

  • Refresh

True


Many-to-one mappings also include the following areas:

One-to-Many Mapping

Property Description Default

Target entity

The persistent entity to which the attribute is mapped.


Fetch

Defines how data is loaded from the database:

  • Eager – Data is loaded in before it is actually needed.

  • Lazy – Data is loaded only when required by the transaction.

Lazy

Join fetch

The type of fetch to use:

  • Inner – Provides the inner join fetching of the related object.

    Note: Inner joining does not allow for null or empty values

  • Outer – Provides the outer join fetching of the related object

    Note: Outer joining allows for null or empty values.


Private owned

Specify that a relationship is privately owned; target object is a dependent part of the source object and is not referenced by any other object and cannot exist on its own.


Orphan removal


False

Cascade

Specify which operations are propagated throughout the entity.

  • All – All operations

  • Persist

  • Merge

  • Move

  • Remove

  • Refresh

True


One-to-many mappings also include the following areas:

One-to-One Mapping

Property Description Default

Target entity

The persistent entity to which the attribute is mapped.


Fetch

Defines how data is loaded from the database:

  • Eager – Data is loaded in before it is actually needed.

  • Lazy – Data is loaded only when required by the transaction.

Eager

Join fetch

The type of fetch to use:

  • Inner – Provides the inner join fetching of the related object.

    Note: Inner joining does not allow for null or empty values

  • Outer – Provides the outer join fetching of the related object

    Note: Outer joining allows for null or empty values.


Optional

Specifies if this field is can be null.

True

Private owned

Specify that a relationship is privately owned; target object is a dependent part of the source object and is not referenced by any other object and cannot exist on its own.

False

Orphan removal


False

Cascade

Specify which operations are propagated throughout the entity.

  • All – All operations

  • Persist

  • Merge

  • Move

  • Remove

  • Refresh

True


One-to-one mappings also include the following areas:

Version Mapping

Property Description Default

Column

The database column that contains the value for the attribute. This field corresponds to the @Column annotation.

By default, the Column is assumed to be named identically to the attribute.

Name

The database column mapped to the entity attribute.

By default, the Column is assumed to be named identically to the attribute and always included in the INSERT and UPDATE statements.


Table

Name of the database table that contains the selected column.


Details



Insertable

Specifies if the column is always included in SQL INSERT statements.

True

Updatable

Specifies if this column is always included in SQL UPDATE statements.

True

Unique

Sets the UNIQUE constraint for the column.

False

Nullable

Specifies if the column allows null values.

True

Length

Sets the column length.

255

Precision

Sets the precision for the column values.

0

Scale

Sets the number of digits that appear to the right of the decimal point.

0

Column definition

The SQL fragment that is used when generating the DDL for the column.


Mutable

Specify if the value of a complex field type can be changed (or not changed) instead of being replaced.

True


Version mappings also include the following areas:

Type information

Property Description Available for Mapping Type

Default


Basic mapping, ID mapping, and Version mapping

LOB

Specify if the field is mapped to java.sql.Clob or java.sql.Blob.

This field corresponds to the @Lob annotation.

Basic mapping


Temporal

Specifies if this field is one of the following:

  • Date – java.sql.Date

  • Time – java.sql.Time

  • Timestamp – java.sql.Timestamp

This field corresponds to the @Temporal annotation.

Basic mapping, ID mapping, and Version mapping

Enumerated

Specify how to persist enumerated constraints if the String value suits your application requirements or to match an existing database schema.

  • ordinal

  • String

This field corresponds to the @Enumerated annotation.

Basic mapping


Converted

Converter name:

  • None (default) –

  • class-instance –

  • serialized –

Basic mapping, ID mapping, and Version mapping


Value

Converters

Use this area to specify a custom converter for modification of the data value(s) during the reading and writing of a mapped attribute.

Property Description Default Available for Entity Type

Converters

Click Add and use the Add Converter dialog to create a new converter.

  • Object Type

  • Type

  • Struct

  • Custom


Basic mapping, Element collection mapping, ID mapping, Many-to-many mapping, One-to-many mapping, and Version mapping

Name

Name of the converter.



Class

Appears for Custom and Struct converters only.



Data type

Appears for Object Type and Type converters only.



Object type

Appears for Object Type and Type converters only.



Conversion values

Appears for Object Type converters only.



Default object value

Appears for Object Type converters only.




Related reference

Ordering

Specify the default order for objects returned from a query. These options correspond to the @OrderBy annotation.

Property Description Default Available for Entity Type

Name



Element collection mapping, Many-to-many mapping, and One-to-many mapping

Primary key




Custom




Order column




Insertable

Specify if the column is included in SQL INSERT statements

True


Updatable

Specify if the column is included in SQL UPDATE statements

True


Nullable

Specify if the database column is nullable

True


Column definition

The SQL fragment that used to generate the DDL for the column

Generated SQL to create a column of the inferred type



Joining Strategy

Use this area to specify a mapped column for joining an entity association. By default, the mapping is assumed to have a single join.

Property Description Available for Mapping Type

Mapped by

The field in the database table that "owns" the relationship. This field is required only on the non-owning side of the relationship.

Many-to-many mapping, One-to-many mapping, and One-to-one mapping

Attribute



Primary key join columns


One-to-one mapping


Join columns

By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.

Select Override Default, then Add, Edit, or Remove the join columns.

Many-to-one mapping, One-to-many mapping, and One-to-one mapping

Join table


Many-to-many mapping, Many-to-one mapping, One-to-many mapping, and One-to-one mapping

Name

Name of the join table that contains the foreign key column.You must specify the join table on the owning side.

By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.


Schema

Schema of the table


Catalog

Catalog of the table


Join columns

The foreign key columns of the join table which reference the primary table of the entity owning the association. (that is, the owning side of the association).


Inverse join columns

The foreign key columns of the join table which reference the primary table of the entity that does not own the association. (that is, the inverse side of the association).



Derived Identity

Property Description Available for Mapping Type

None


Many-to-one mapping and One-to-one mapping

ID


Many-to-one mapping and One-to-one mapping

Maps ID


Many-to-one mapping and One-to-one mapping


Primary Key Generation information

This table lists the fields available in the Primary Key Generation area in JPA Details view for ID mapping types.

Property Description Default

Primary Key Generation

These fields define how the primary key is generated. These fields correspond to the @GeneratedValue annotation.

Generated Value

Strategy

  • Auto

  • Identity – Values are assigned by the database's Identity column.

  • Sequence – Values are assigned by a sequence table (see Sequence Generator).

  • Table – Values are assigned by a database table (see Table Generator).

Auto

Generator Name

Unique name of the generated value.


Table Generator

These fields define the database table used for generating the primary key and correspond to the @TableGenerator annotation.

These fields apply only when Strategy = Table.


Name

Unique name of the generator.


Table

Database table that stores the generated ID values.


Schema

Schema of the table


Catalog

Catalog of the table


Primary Key Column

The column in the table generator's Table that contains the primary key.


Value Column

The column that stores the generated ID values.


Primary Key Column Value

The value for the Primary Key Column in the generator table.


Allocation size



Initial value



Sequence Generator

These fields define the specific sequence used for generating the primary key and correspond to the @SequenceGenerator annotation.

These fields apply only when Strategy = Sequence.


Name

Name of the sequence table to use for defining primary key values.


Sequence

Unique name of the sequence.


Schema



Catalog



Allocation size



Initial value




Related tasks

Related reference

JPA Details view (for orm.xml)

The JPA Details view displays the default mapping and persistence information for the project and contains the following areas:

These defaults can be overridden by the settings on a specific entity or mapping.

Entity Mappings

This table lists the Entity Mappings fields available in the JPA Details view for each entity type.

Property Description Default

Package

The Java package that contains the persistent entities. Click Browse and select the package


Schema

The database schema that contains the Table.

This field corresponds to the <schema> element in the orm.xml file.


Catalog

The database catalog that contains the Table.

This field corresponds to the <catalog> element in the orm.xml file.


Access

Specify the default access method for the variables in the project:

  • Property

  • Field

This field corresponds to the <access> element in the orm.xml file.



Related tasks

Related reference

Persistence Unit

This table lists the Persistence Unit information fields available in the JPA Details view for each entity type. These fields are contained in the <persistence-unit-metadata> element in the orm.xml file.

Property Description Default

XML Mapping Data Complete

Specifies that the Java classes in this persistence unit are fully specified by their metadata. Any annotations will be ignored.

This field corresponds to the <xml-mapping-metadata-complete> element in the orm.xml file.


Cascade Persist

Adds cascade-persist to the set of cascade options in entity relationships of the persistence unit.

This field corresponds to the <cascade-persist> element in the orm.xml file.


Schema

The database schema that contains the Table.

This field corresponds to the <schema> element in the orm.xml file.


Catalog

The database catalog that contains the Table.

This field corresponds to the <catalog> element in the orm.xml file.


Access

Specify how the entity its access instance variables.

  • Property – Persistent state accessed through the property accessor methods. The property accessor methods must be public or private.

  • Field – Instance variables are accessed directly. All non-transient instance variables are persistent.


Deliminated identifiers




Related tasks

Related reference

Generators

This table lists the Generator fields available in the JPA Details view for the orm.xml file.

Property Description Default

Generators

Click Add to create a new table or sequence generator, or select an existing generator and click Remove, to add or remove a generator.


Sequence Generators



Name



Sequence



Schema



Catalog



Allocation size


50

Initial value


1

Table Generators



Name



Table



Schema



Catalog



Primary key column value



Allocation size


50

Initial value


1


Related tasks

Related reference

Queries

This table lists the Query information fields available in the JPA Details view for the orm.xml file.

Property Description Default

Queries

Displays the existing Named and Native queries.

Click Add to add a named query, or Add Native for a native query.

For named queries, enter the query in the Query field.

For native queries, select a result class, then enter the query in the Query field.


Named Queries



Name



Query



Lock mode


None

Native Queries



Name



Result class



Query



Query Hints

Displays the existing query hints (Name and Value).

Click Add to add a new query hint.



Related tasks

Related reference

Converters

The Converters information in the JPA Details view applies only when using EclipseLink.

Click Add to create a new converter, using the Add Converter dialog.

Related reference

JPA Structure view

The JPA Structure view displays an outline of the structure (its attributes and mappings) of the entity that is currently selected or opened in the editor. The structural elements shown in the outline are the entity and its fields.

Figure 4-1 Sample JPA Structure View

Sample JPA Structure view for an entity.

Related reference

persistence.xml Editor

The persistence.xml Editor provides an interface that enables you to update the persistence.xml file. For projects using the EclipseLink platform, the perisistence.xml Editor consists of the following pages:

For projects using the Generic platform, the following subset of these pages is available:

General

The following table lists properties available in the General page of the persistence.xml Editor.

Property Description Default

General



Name

Enter the name of the persistence unit.

Defines the <persistence-unit name> element.

The project name

Persistence provider

Enter the name of the persistence provider.

Defines the <provider> element.

Determined by the server

Description

Enter a description for this persistence unit. This is an optional property.

Defines the <description> element.


Managed Classes



Classes

Click Add to add a new class, or select an existing class and click Remove, to add or remove the classes managed through the persistence unit.

Defines the <class> element.

Select a class and click Open to modify the class in the editor.


Exclude Unlisted Classes

Select to include all annotated entity classes in the root of the persistence unit.

Defines the <exclude-unlisted-classes> element.

False

XML Mapping Files



Files

Click Add to select an XML mapping file, or select an existing file and click Remove, to add or remove an object/relational mapping XML files that define the classes to be managed by the persistence unit.

Defines the <mapping-file> element.

Meta-INF\orm.xml

Exclude default EclipseLink XML mapping file

Select to include all annotated EclipseLink mapping files. Defines the eclipselink.exclude-eclipselink-orm property element.Note: This field applies only when using EclipseLink JPA implementation

False

JAR Files



Files

Click Add to select a JAR file, or select an existing file and click Remove, to add or remove JAR files and libraries in the persistence unit.



Connection

The following table lists the properties available in the Connection page of the persistence.xml Editor.

Property Description Default

Transaction type

Specify if the connection for this persistence unit uses one of the following transaction types:

  • Default -- Select to use the container used by the container.

  • JTA (Java Transaction API) -- Transactions of the Java EE server.

  • Resource Local -- Native actions of a JDBC driver that are referenced by a persistence unit.

JTA

Batch writing

Specify the use of batch writing to optimize transactions with multiple write operations.

Set the value of this property into the session at deployment time.

Note: This property applies when used both in a Java SE and Java EE environment.

The following are the valid values for oracle.toplink.config.BatchWriting:

  • JDBC–Use JDBC batch writing.

  • Buffered–Do not use either JDBC batch writing nor native platform batch writing.

  • OracleJDBC–Use both JDBC batch writing and Oracle native platform batch writing.

  • None–Do not use batch writing (turn it off).

None

Statement caching

Specify if the query caches its JDBC statement. If enabled, you can also set the number of statements to cache.

50

Native SQL

Specify if Dali includes platform-specific (that is, "native") SQL statements. If false, Dali uses generic SLQ.

False

Database



JTA Data Source Name

If you selected JTA as the transaction type, then enter the name of the default JTA data source for the persistence unit.


Non-JTA Data Source Name

If you selected Resource Local as the transaction type, then enter the name of the non-JTA data source.

This property is not available for projects using the Generic platform.


EclipseLink connection pool

Define the connection pool driver, URL, user name and password.

These properties are note available for projects using the Generic platform.


Bind parameters

Control whether or not the query uses parameter binding.

Note: This property applies when used in a Java SE environment.

This property is not available for projects using the Generic platform.

True

Read Connection

The maximum and minimum number of connections allowed in the JDBC read connection pool.

Note: These property apply when used in a Java SE environment.

These properties are not available for projects using the Generic platform

Minimum: 2

Maximum 2

Write Connection

The maximum and minimum number of connections allowed in the JDBC read connection pool.

Note: These property apply when used in a Java SE environment.

These properties are not available for projects using the Generic platform

Minimum: 5

Maximum 10

Exclusive connections

These fields are available only when Transaction Type is Local Resource.


Exclusive connection mode

Specify when Dali performs reads through the write connection.

  • Always – Create an exclusive isolated client session if reading an isolated entity, otherwise create an exclusive client session.

  • Isolated – Create an exclusive isolated client session if reading an isolated entity, otherwise raise an error.

  • Transactional – Create an isolated client session if some or all entities require isolated cache, otherwise create a client session.

Transactional

Lazy connection acquisition

Specify if Dali acquires write connections lazily.

True


Related references

Customization

The following table lists the properties available in the Customization page of the persistence.xml Editor.

Property Description Default

Weaving

Specifies if weaving of the entity classes is performed. The EclipseLink JPA persistence provider uses weaving to enhance JPA entities for such properties as lazy loading, change tracking, fetch groups, and internal optimizations. Select from the following options:

  • No Weaving

  • Weave Dynamically

  • Weave Statically -- Use this option if you plan to execute your application outside of a Java EE 5 container in an environment that does not permit the use of -javaagent:eclipselink.jar on the JVM command line. This assumes that classes have already been statically woven. Run the static weaver on the classes before deploying them.

Weave Dynamically

Lazy

Select this option to enable lazy weaving.

True

Fetch Groups

Select this option to enable fetch groups through weaving. Set this option to false if:

  • There is no weaving.

  • Classes should not be changed during weaving (for example, when debugging).

Set this property to false for platforms where it is not supported.

True

Internal

Specify if Dali uses internal optimizations through weaving.

If enabled, enables lazy one-to-one and many-to-one mappings through weaving.

True

Eager

Specify if Dali uses indirection on eager relationships.

False

Change Tracking

Select this option to use weaving to detect which fields or properties of the object change.

True

Validation only

Specify if Dali should validate deployments by initializing descriptors but not connecting to the data source.

True

Mapping files schema validation


False

Throw exceptions

Select this option to set EclipseLink to throw an exception or log a warning when it encounters a problem with any of the files listed in a persistence.xml file <mapping-file> element.

True

Exception handler

Select (or create) a Java class (that implements the org.eclipse.persistence.exceptions.ExceptionHandler interface) to handle exceptions.


Session Customizer

Select a session customizer class: a Java class that implements the eclipselink.tools.sessionconfiguration.SessionCustomizer interface and provides a default (zero-argument) constructor. Use this class' customize method, which takes an eclipselink.sessions.Session, to programmatically access advanced EclipseLink session API.


Profiler

Specify which performance profiler to use in order to capture runtime statistics.

  • No Profiler – Do not use a performance profiler.

  • Performance Profiler – Use EclipseLink performance profiler (org.eclipse.persistence.tools.profiler.PerformanceProfiler class).

  • Query Monitor – Monitor query executions and cache hits (org.eclipse.persistence.tools.profiler.QueryMonitor class).

NoProfiler



Note:

This page is not available for projects using the Generic platform.


Related references

Caching

This table lists the properties of the Caching page of the persistence.xml Editor.

Property Description Default

Shared cache mode

Select one of the following as the shared cache mode:

  • All – .

  • None

  • Enable Selective

  • Disable Selective

  • Unspecified

Disable selective

Default Cache Type

Select one of the following as the Default Cache Type:

  • Weak with Soft Subcache–This option is similar to Weak with Hard Subcache except that it maintains a most frequently used subcache that uses soft references. The size of the subcache is proportional to the size of the identity map. The subcache uses soft references to ensure that these objects are garbage-collected only if the system is low on memory.

    Use this identity map in most circumstances as a means to control memory used by the cache.

  • Weak with Hard Subcache–This option is similar to Soft with Weak subcache except that it maintains a most frequently used subcache that uses hard references. Use this identity map if soft references are not suitable for your platform.

  • Weak–This option is similar to Full, except that objects are referenced using weak references. This option uses less memory than Full, allows complete garbage collection and provides full caching and guaranteed identity.

    Use this identity map for transactions that, once started, stay on the server side.

  • Soft–This option is similar to Weak except that the map holds the objects using soft references. This identity map enables full garbage collection when memory is low. It provides full caching and guaranteed identity.

  • Full–This option provides full caching and guaranteed identity: all objects are cached and not removed.

    Note: This process may be memory-intensive when many objects are read.

  • None–This option does not preserve object identity and does not cache objects.This option is not recommended.

Weak with soft subcache

Default Cache Size

Set the size (maximum number of objects) of the cache.

100

Flush clear cache

Select one of the following as the Default Cache Type:

  • Drop – This mode is the fastest and uses the least memory. However, after commit the shared cache might potentially contain stale data.

  • Drop Invalidate – Classes that have at least one object updated or deleted are invalidated in the shared cache at commit time. This mode is slower than Drop, but as efficient memory usage-wise, and prevents stale data.

  • Merge – Drop classes from the EntityManager's cache of objects that have not been flushed. This mode leaves the shared cache in a perfect state after commit. However, it is the least memory-efficient mode; the memory might even run out in a very large transaction.

Drop Invalidate



Note:

This page is not available for projects using the Generic platform.


Related references

Logging

This table lists the properties of the Logging page of the persistence.xml Editor.


Note:

This page is not available for projects using the Generic platform.


Property Description Default

Logging Level

Specifies the amount and detail of log output by selecting the log level (in ascending order of information):

The following are the valid values for the java.util.logging.Level:

  • OFF–disables logging

  • SEVERE–logs exceptions indicating TopLink cannot continue, as well as any exceptions generated during login. This includes a stack trace.

  • WARNING–logs exceptions that do not force TopLink to stop, including all exceptions not logged with severe level. This does not include a stack trace.

  • INFO–logs the login/logout per sever session, including the user name. After acquiring the session, detailed information is logged.

  • CONFIG–logs only login, JDBC connection, and database information.

  • FINE–logs SQL.

  • FINER–similar to warning. Includes stack trace.

  • FINEST–includes additional low level information.

Example: persistence.xml file

<property name="eclipselink.logging.level" value="INFO"/>

Info

Timestamp

Control whether the timestamp is logged in each log entry.

The following are the valid values:

  • True–log a timestamp.

  • False–do not log a timestamp.

Example: persistence.xml file

<property name="eclipselink.logging.timestamp" value="false"/>

True

Thread

Control whether a thread identifier is logged in each log entry.

The following are the valid values:

  • true–log a thread identifier.

  • false–do not log a thread identifier.

True

Session

Control whether an EclipseLink session identifier is logged in each log entry.

The following are the valid values:

  • true–log a EclipseLink session identifier.

  • false–do not log a EclipseLink session identifier.

Example: persistence.xml file

<property name="eclipselink.logging.session" value="false"/>

true

Exceptions

Control whether the exceptions thrown from within the EclipseLink code are logged prior to returning the exception to the calling application. Ensures that all exceptions are logged and not masked by the application code.

The following are the valid values:

  • true–log all exceptions.

  • false–do not log exceptions.

Example: persistence.xml file

<property name="eclipselink.logging.exceptions" value="true"/>

false

Log file

Specify a file location for the log output (instead of the standard out).

Example: persistence.xml file

<property name="eclipselink.logging.file" value="C:\myout\" />

stdout

Logger

Select the type of logger to use:

The following are the valid values:

  • DefaultLogger–the EclipseLink native logger eclipselink.logging.DefaultSessionLog.

  • JavaLogger–the java.util.logging logger eclipselink.logging.JavaLog.

  • ServerLogger–the java.util.logging logger eclipselink.platform.server.ServerLog. Integrates with the application server's logging as define in the eclipselink.platform.server.ServerPlatform.

  • Fully qualified class name of a custom logger. The custom logger must implement the eclipselink.logging.SessionLog interface.

Example: persistence.xml file

<property name="eclipselink.logging.logger" value="acme.loggers.MyCustomLogger" />

DefaultLogger

Logging Categories

You can also specify the logging level for the following specific categories:

  • SQL

  • Connection

  • Event

  • Query

  • Cache

  • Propagation

  • EJB

  • DMS

  • EJB or metatdata

  • JPA metadata

  • Weaving

  • Properties

  • Server

Info


Related references

Options

This table lists the properties of the Options page of the persistence.xml Editor.


Note:

This page is not available for projects using the Generic platform.


Property Description Default

Session Options



Session Name

Specify the name by which the EclipseLink session is stored in the static session manager. Use this option if you need to access the EclipseLink shared session outside of the context of the JPA or to use a pre-existing EclipseLink session configured through a EclipseLink sessions.xml file

Valid values: a valid EclipseLink session name that is unique in a server deployment.

Example: persistence.xml file

<property name="eclipselink.session-name" value="MySession"/>

Sessions XML

Specify persistence information loaded from the EclipseLink session configuration file (sessions.xml).

You can use this option as an alternative to annotations and deployment XML. If you specify this property, EclipseLink will override all class annotation and the object relational mapping from the persistence.xml, as well as ORM.xml and other mapping files, if present.

Indicate the session by setting the eclipselink.session-name property.

Note: If you do not specify the value for this property, sessions.xml file will not be used.

Valid values: the resource name of the sessions XML file.

Example: persistence.xml file

<property name="toplink.session-xml" value="mysession.xml"/>

Target Database

Select the target database. You can also set the value to the fully qualified class name of a subclass of the org.eclipse.persistence.platform.DatabasePlatform class.

Example: persistence.xml file

<property name="eclipselink.target-database" value="Oracle"/>

Auto

Target Server

Select the target server for your JPA application.

Example: persistence.xml file

<property name="eclipselink.target-server" value="OC4J_10_1_3"/>

None

Event Listener

Specify a descriptor event listener to be added during bootstrapping.

Valid values: qualified class name for a class that implements the eclipselink.sessions.SessionEventListener interface.

Example: persistence.xml file

<property name="eclipselink.session-event-listener" value="mypackage.MyClass.class"/>

Include Descriptor Queries

Enable or disable the default copying of all named queries from the descriptors to the session. These queries include the ones defined using EclipseLink API, descriptor amendment methods, and so on.

True

Miscellaneous Options



Temporal mutable

Specify if all Date and Calendar persistent fields should be handled as mutable objects.

Example: persistence.xml file

<property name="eclipselink.temporal.mutable" value="true"/>

False

Lock timeout


5

Query timeout


5

Validation mode


Auto

Validate pre-persist group



Validate pre-update group



Validate pre-remove group




Related references

Schema Generation

This table lists the properties of the Schema Generation page of the persistence.xml Editor.


Note:

This page is not available for projects using the Generic platform.


Property Description Default

DDL Generation Type

Select the type of DDL generation:

  • None -- Do not generate DDL; no schema is generated.

  • Create Tables -- Create DDL for non-existent tables; leave existing tables unchanged.

  • Drop and Create Tables -- Create DDL for all tables; drop all existing tables.

None

Output Mode

Select the DDL generation target:

  • Both -- Generate SQL files and execute them on the database.

  • Database -- Execute SQL on the database only (do not generate SQL files).

  • SQL Script -- Generate SQL files only (do not execute them on the database).


DDL Generation Location

Specify where EclipseLink writes DDL output. Specify a file specification to a directory in which you have write access. The file specification may be relative to your current working directory or absolute. If it does not end in a file separator, then EclipseLink appends one that is valid for your operating system.


Create DDL File Name

Specify the file name of the DDL file that EclipseLink generates that contains SQL statements for creating tables for JPA entities. Specify a file name valid for your operating system.

createDDL.jdbc

Drop DDL File Name

Specify the file name of the DDL file that EclipseLink generates that contains SQL statements for dropping tables for JPA entities.

dropDDL.jdbc


Related references

Properties

This page enables you to add or remove the vendor-specific <properties> elements of persistence.xml.

To add a property, click Add then enter the property Name and Value.

Related references

Source

Using this page, you can manually edit the persistence.xml file.

See "Managing the persistence.xml file" for additional information.

Related tasks