Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/Examples/JPA/Migration/OpenJPA/QueryHints"

< EclipseLink‎ | Examples‎ | JPA‎ | Migration‎ | OpenJPA
(New page: == Migrating OpenJPA to EclipseLink JPA: Query Hints == Within a JPA application there is support for specifying query hints which define provider specific behaviour. These hints can be ...)
 
(Migrating OpenJPA to EclipseLink JPA: Query Hints)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Migrating OpenJPA to EclipseLink JPA: Query Hints  ==
 
== Migrating OpenJPA to EclipseLink JPA: Query Hints  ==
  
Within a JPA application there is support for specifying query hints which define provider specific behaviour. These hints can be specified in annotations, within the ORM XML files, or within application code. The query hint names are strings and therefore do not typically force compile time dependencies on a particular provider but the values for these hints may introduce dependencies. The following sections outline OpenJPA query hints and their corresponding EclipseLink JPA features.
+
''NOTE: Under Construction''
  
 +
Within a JPA application there is support for specifying query hints which define provider specific behaviour. These hints can be specified in annotations, within the ORM XML files, or within application code. The query hint names are strings and therefore do not typically force compile time dependencies on a particular provider but the values for these hints may introduce dependencies. The following sections outline OpenJPA query hints and their corresponding EclipseLink JPA features. If any query hint related migration information is missing or incomplete please log a [https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EclipseLink&bug_severity=enhancement documentation enhancement request] referencing this page and provide details of your migration challenge.
  
<blockquote>
+
__TOC__
''Note: This migration information is based on the [http://openjpa.apache.org/builds/1.2.1/apache-openjpa-1.2.1/docs/manual/manual.html OpenJPA 1.2.1 documentation].''
+
</blockquote>
+
  
 
+
{|{{BMTableStyle}}
{|
+
|-{{BMTHStyle}}
|-
+
 
! OpenJPA Hint  
 
! OpenJPA Hint  
 
! Description  
 
! Description  
 
! EclipseLink JPA Equivalent Functionality
 
! EclipseLink JPA Equivalent Functionality
 
|-
 
|-
| openjpa.hint.OracleSelectHint || Specifies an Oracle specific query hint to be generated  ||  
+
| openjpa.hint.OracleSelectHint || Specifies an Oracle specific query hint to be generated  || eclipselink.sql.hint
|-
+
| openjpa.hint. || ||
+
|-
+
| openjpa.hint. || ||
+
|-
+
| openjpa.hint. || ||
+
|-
+
| openjpa.hint. || ||
+
|-
+
| openjpa.hint. || ||
+
|-
+
| openjpa.hint. || ||
+
|-
+
| openjpa.hint. || ||
+
|-
+
| openjpa.hint. || ||
+
|-
+
| openjpa.hint. || ||
+
 
|-
 
|-
| openjpa.hint. || ||  
+
| openjpa.FetchPlan.ReadLockMode || Values= '''READ''' or '''WRITE''' || JPA 2.0's [http://www.eclipse.org/eclipselink/api/2.1/javax/persistence/Query.html#setLockMode%28javax.persistence.LockModeType%29 Query.setLokMode]([http://www.eclipse.org/eclipselink/api/2.1/javax/persistence/LockModeType.html LockModeType])
 
|-
 
|-
| openjpa.hint. || ||  
+
| openjpa.hint.OptimizeResultCount || Integer value greater than zero || [http://www.eclipse.org/eclipselink/api/2.1/org/eclipse/persistence/config/QueryHints.html#JDBC_FETCH_SIZE QueryHints.JDBC_FETCH_SIZE]
 
|-
 
|-
| openjpa.hint. || ||  
+
| openjpa.FetchPlan.Isolation || ||
 
|-
 
|-
| openjpa.hint. || ||  
+
| openjpa.FetchPlan.MaxFetchDepth || || FetchGroup depth specified by attributes in EclipseLink and not by numeric depth
 
|-
 
|-
| openjpa.hint. || ||  
+
| openjpa.FetchPlan.FetchBatchSize|| || Query.setMaxResults <br/> [http://www.eclipse.org/eclipselink/api/2.1/org/eclipse/persistence/config/QueryHints.html#JDBC_MAX_ROWS QueryHints.JDBC_MAX_ROWS] 
 
|-
 
|-
| openjpa.hint. || ||  
+
| openjpa.FetchPlan.LockTimeOut|| Number of ms to wait to acquire a lock (-1 means no limit) || [http://www.eclipse.org/eclipselink/api/2.1/org/eclipse/persistence/config/QueryHints.html#PESSIMISTIC_LOCK_TIMEOUT QueryHints.PESSIMISTIC_LOCK_TIMEOUT]
 
|-
 
|-
| openjpa.hint. || ||  
+
| openjpa.FetchPlan.EagerFetchMode || || FetchGroup loading is done based on attributes specified or in the case of the default FetchGroup the lazy configuration of the mappings.
 
|-
 
|-
| openjpa.hint. || ||  
+
| openjpa.FetchPlan.SubclassFetchMode || Determines how to eager-fetch subclass data || FetchGroup attributes can be for any mapped attribute in the target entity or its mapped parent classes.
 
|}
 
|}

Latest revision as of 13:23, 29 June 2010

Migrating OpenJPA to EclipseLink JPA: Query Hints

NOTE: Under Construction

Within a JPA application there is support for specifying query hints which define provider specific behaviour. These hints can be specified in annotations, within the ORM XML files, or within application code. The query hint names are strings and therefore do not typically force compile time dependencies on a particular provider but the values for these hints may introduce dependencies. The following sections outline OpenJPA query hints and their corresponding EclipseLink JPA features. If any query hint related migration information is missing or incomplete please log a documentation enhancement request referencing this page and provide details of your migration challenge.

OpenJPA Hint Description EclipseLink JPA Equivalent Functionality
openjpa.hint.OracleSelectHint Specifies an Oracle specific query hint to be generated eclipselink.sql.hint
openjpa.FetchPlan.ReadLockMode Values= READ or WRITE JPA 2.0's Query.setLokMode(LockModeType)
openjpa.hint.OptimizeResultCount Integer value greater than zero QueryHints.JDBC_FETCH_SIZE
openjpa.FetchPlan.Isolation
openjpa.FetchPlan.MaxFetchDepth FetchGroup depth specified by attributes in EclipseLink and not by numeric depth
openjpa.FetchPlan.FetchBatchSize Query.setMaxResults
QueryHints.JDBC_MAX_ROWS
openjpa.FetchPlan.LockTimeOut Number of ms to wait to acquire a lock (-1 means no limit) QueryHints.PESSIMISTIC_LOCK_TIMEOUT
openjpa.FetchPlan.EagerFetchMode FetchGroup loading is done based on attributes specified or in the case of the default FetchGroup the lazy configuration of the mappings.
openjpa.FetchPlan.SubclassFetchMode Determines how to eager-fetch subclass data FetchGroup attributes can be for any mapped attribute in the target entity or its mapped parent classes.

Back to the top