Class Session

java.lang.Object
de.calamanari.pk.identitymap.Session

public class Session
extends java.lang.Object
Session - supplementary class, the place where the IDENTITY MAPs reside in this example.
Author:
Karl Eilebrecht
  • Constructor Summary

    Constructors
    Constructor Description
    Session()  
  • Method Summary

    Modifier and Type Method Description
    static void cleanUp()
    Method to be called when the current thread does not need the session data anymore.
    static Session getCurrentSession()
    Returns the current session from our simulated session management
    <K,​ E extends Entity<K>>
    IdentityMap<K,​E>
    getIdentityMap​(java.lang.Class<E> entityType)
    This is used by the finder to lookup the corresponding identity map for an entity

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getCurrentSession

      public static final Session getCurrentSession()
      Returns the current session from our simulated session management
      Returns:
      session
    • getIdentityMap

      public <K,​ E extends Entity<K>> IdentityMap<K,​E> getIdentityMap​(java.lang.Class<E> entityType)
      This is used by the finder to lookup the corresponding identity map for an entity
      Type Parameters:
      K - some key type
      E - some entity with key of corresponding type
      Parameters:
      entityType - class object of entity
      Returns:
      identity map for the given entity type, never null
    • cleanUp

      public static void cleanUp()
      Method to be called when the current thread does not need the session data anymore.