Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EclipseLink/Development/Dynamic/Design NativeXML"
< EclipseLink | Development | Dynamic
(→= Project XML Usage) |
|||
Line 7: | Line 7: | ||
# Sessions.xml with Project deployment XML with EclipseLink JPA (using PU properties) | # Sessions.xml with Project deployment XML with EclipseLink JPA (using PU properties) | ||
− | === Project XML Usage == | + | === Project XML Usage - Native === |
The [http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/incubator/dynamic/branches/1.1.0/org.eclipse.persistence.core.dynamic/src/org/eclipse/persistence/dynamic/EntityTypeBuilder.java EntityTypeBuilder] provides a static helper that allows a resource string describing the location of the project's deployment XMl file and a DatabaseLogin specifying the database connection/pool information. | The [http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/incubator/dynamic/branches/1.1.0/org.eclipse.persistence.core.dynamic/src/org/eclipse/persistence/dynamic/EntityTypeBuilder.java EntityTypeBuilder] provides a static helper that allows a resource string describing the location of the project's deployment XMl file and a DatabaseLogin specifying the database connection/pool information. | ||
Line 18: | Line 18: | ||
session.setLogLevel(SessionLog.FINE); | session.setLogLevel(SessionLog.FINE); | ||
session.login(); | session.login(); | ||
+ | </source> | ||
+ | |||
+ | === Sessions.xml with Project XML - Native === | ||
+ | |||
+ | TBD | ||
+ | |||
+ | === Sessions.xml with Project XML - JPA === | ||
+ | |||
+ | This configuration allows the sessions XML and project XML to be used directly through the JPA bootstrap API. It requires the additional use of persistence unit properties to specify the PU location and PU name. | ||
+ | |||
+ | <source lang="xml"> | ||
+ | <property name="eclipselink.sessions-xml" value="META-INF/mysession.xml"/> | ||
+ | <property name="eclipselink.session-name" value="MySession"/> | ||
</source> | </source> |
Revision as of 14:23, 10 September 2009
Contents
Dynamic Persistence Design: Native XML Configuration
The dynamic persistence support includes the use of XML to define the mappings and in effect the dynamic entity class structure. This support includes:
- Project deployment XML with Native ORM API
- Sessions.xml with Project deployment XML with Native ORM API
- Sessions.xml with Project deployment XML with EclipseLink JPA (using PU properties)
Project XML Usage - Native
The EntityTypeBuilder provides a static helper that allows a resource string describing the location of the project's deployment XMl file and a DatabaseLogin specifying the database connection/pool information.
DatabaseLogin login = AllTests.getTestLogin(); Project project = EntityTypeBuilder.loadDynamicProject("org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/Employee_utf8.xml", login); DatabaseSession session = project.createDatabaseSession(); session.setLogLevel(SessionLog.FINE); session.login();
Sessions.xml with Project XML - Native
TBD
Sessions.xml with Project XML - JPA
This configuration allows the sessions XML and project XML to be used directly through the JPA bootstrap API. It requires the additional use of persistence unit properties to specify the PU location and PU name.
<property name="eclipselink.sessions-xml" value="META-INF/mysession.xml"/> <property name="eclipselink.session-name" value="MySession"/>