You can use the following EclipseLink JPA persistence unit properties in a persistence.xml file to configure EclipseLink extensions for a session, and as the target database and application server.
Defines the name by which the EclipseLink session is stored in the static session manager. Use this option if you must access the EclipseLink shared session outside of the context of the JPA. Use this option also to use a preexisting EclipseLink session that is configured through an EclipseLink sessions.xml file.
Values: A valid EclipseLink session name that is unique in a server deployment.
Default: EclipseLink-generated unique name.
Example:
persistence.xml file<property value="MySession"/> Example: property Mapimport org.eclipse.persistence.config.PersistenceUnitProperties;propertiesMap.put(PersistenceUnitProperties.SESSION_NAME, "MySession");
Defines the persistence information that is 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 overrides all class annotation and the object relational mapping from the persistence.xml, and ORM.xml and other mapping files.
To indicate the session, set the eclipselink.session-name property.
Note: If you do not specify the value for this property, sessions.xml file is not used.
Values: The resource name of the sessions XML file.
Example:
persistence.xml file<property value="mysession.xml"/> Example: property Mapimport org.eclipse.persistence.config.PersistenceUnitProperties;propertiesMap.put(PersistenceUnitProperties.SESSIONS_XML, "mysession.xml");
Defines a descriptor event listener to be added during bootstrapping.
Values: Qualified class name for a class that implements the org.eclipse.persistence.sessions.SessionEventListener interface.
Example:
Persistence.xml file<property value="mypackage.MyClass.class"/> Example: property Mapimport org.eclipse.persistence.config.PersistenceUnitProperties;propertiesMap.put(PersistenceUnitProperties.SESSION_EVENT_LISTENER_CLASS, "mypackage.MyClass.class");
Specifies whether to copy all named queries from the descriptors to the session by default. These queries include the ones that are defined using EclipseLink API, descriptor amendment methods, and others.
Values:
Default: true.
Example:
Persistence.xml file<property value="false"/>Example: property Mapimport org.eclipse.persistence.config.PersistenceUnitProperties;propertiesMap.put(PersistenceUnitProperties.INCLUDE_DESCRIPTOR_QUERIES, "false");
Specifies the type of database that your JPA application uses.
Values:
The following values are valid for use in a persistence.xml file and for the org.eclipse.persistence.config.TargetDatabase:
Default: Auto
Example:
Persistence.xml file<property value="Oracle"/>Example: property Mapimport org.eclipse.persistence.config.TargetDatabase;import org.eclipse.persistence.config.PersistenceUnitProperties;propertiesMap.put(PersistenceUnitProperties.TARGET_DATABASE, TargetDatabase.Oracle);
Specifies the type of application server that your JPA application uses.
Values:
The following values are valid for use in the persistence.xml file and the org.eclipse.persistence.config.TargetServer:
Default: None
Example:
persistence.xml file<property value="OC4J_10_1_3"/>Example: property Mapimport org.eclipse.persistence.config.TargetServer;import org.eclipse.persistence.config.PersistenceUnitProperties;propertiesMap.put(PersistenceUnitProperties.TARGET_SERVER, TargetServer.OC4J_10_1_3);
Copyright © 2014 CA Technologies.
All rights reserved.
|
|