org.compass.gps.device.jpa.embedded.toplink
Class TopLinkHelper

java.lang.Object
  extended by org.compass.gps.device.jpa.embedded.toplink.TopLinkHelper

public abstract class TopLinkHelper
extends Object

Helper class to get different Compass constructs embedded with TopLink.

Author:
kimchy

Method Summary
static JpaCompassGps createCompassGps(JpaGpsDevice device)
          A helper class to create the JpaCompasGps based on the passed device.
static Compass getCompass(javax.persistence.EntityManager em)
          Returns the Compass instance assoicated with the given TopLink EntityManager.
static Compass getCompass(javax.persistence.EntityManagerFactory emf)
          Returns the Compass instance assoicated with the given TopLink EntityManagerFactory.
static JpaCompassGps getCompassGps(javax.persistence.EntityManager em)
          Returns the Compass Gps instance associated with the given TopLink EntityManager.
static JpaCompassGps getCompassGps(javax.persistence.EntityManagerFactory emf)
          Returns the Compass Gps instance associated with the given TopLink EntityManagerFactory.
static CompassSession getCurrentCompassSession(javax.persistence.EntityManager em)
          Returns the current Compass session associated with the EntityManager.
static CompassSession getCurrentCompassSession(oracle.toplink.essentials.sessions.Session session)
          Returns the current Compass session associated with the EntityManager.
static Properties getIndexSettings(javax.persistence.EntityManager em)
          Returns the index settings that are configured within the EntityManager configuration.
static Properties getIndexSettings(javax.persistence.EntityManagerFactory emf)
          Returns the index settings that are configured within the EntityManagerFactory configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCompass

public static Compass getCompass(javax.persistence.EntityManagerFactory emf)
Returns the Compass instance assoicated with the given TopLink EntityManagerFactory. This allows to get a Compass instnace in order to perform search operations for example outside of a JPA transaction (for performance reasons, mostly there is no need to start a DB transaction).


getCompass

public static Compass getCompass(javax.persistence.EntityManager em)
Returns the Compass instance assoicated with the given TopLink EntityManager. This allows to get a Compass instnace in order to perform search operations for example outside of a JPA transaction (for performance reasons, mostly there is no need to start a DB transaction).


getIndexSettings

public static Properties getIndexSettings(javax.persistence.EntityManagerFactory emf)
Returns the index settings that are configured within the EntityManagerFactory configuration. Can be used to configure exteranally a JpaCompassGps instance.


getIndexSettings

public static Properties getIndexSettings(javax.persistence.EntityManager em)
Returns the index settings that are configured within the EntityManager configuration. Can be used to configure exteranally a JpaCompassGps instnace.


getCurrentCompassSession

public static CompassSession getCurrentCompassSession(javax.persistence.EntityManager em)
Returns the current Compass session associated with the EntityManager. Compass Session is associated with an Entity Manager when a transaction is started and removed when the transaction commits/rollsback.

The session can be used to perform searches that needs to take into account current transactional changes or to perform additional Compass operations that are not reflected by the mirroring feature.


getCurrentCompassSession

public static CompassSession getCurrentCompassSession(oracle.toplink.essentials.sessions.Session session)
Returns the current Compass session associated with the EntityManager. Compass Session is associated with an Entity Manager when a transaction is started and removed when the transaction commits/rollsback.

The session can be used to perform searches that needs to take into account current transactional changes or to perform additional Compass operations that are not reflected by the mirroring feature.


getCompassGps

public static JpaCompassGps getCompassGps(javax.persistence.EntityManagerFactory emf)
Returns the Compass Gps instance associated with the given TopLink EntityManagerFactory. Used in order to perform CompassGps.index() operation. Note, the index operation should not be perfomed within a running transaction.


getCompassGps

public static JpaCompassGps getCompassGps(javax.persistence.EntityManager em)
Returns the Compass Gps instance associated with the given TopLink EntityManager. Used in order to perform CompassGps.index() operation. Note, the index operation should not be perfomed within a running transaction.


createCompassGps

public static JpaCompassGps createCompassGps(JpaGpsDevice device)
A helper class to create the JpaCompasGps based on the passed device.



Copyright (c) 2004-2008 The Compass Project.