Class Session

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

public class Session
extends java.lang.Object
Session - supplementary class for MAPPER demonstration
According to Martin Fowler the mapper can't be invoked directly by either of the two components it is connected to, because they both don't even know of the mapper.
One solution is a third party driving the mapper. In this example a session is responsible for this task.
Author:
Karl Eilebrecht
  • Constructor Summary

    Constructors
    Constructor Description
    Session()
    Creates new session
  • Method Summary

    Modifier and Type Method Description
    void add​(AbstractMapper mapper)
    Adds a mapper to the session management
    void confirm()
    Write-back any changes and close session, instances obtained within this session are no longer valid
    void discard()
    Discard any changes and close session, instances obtained within this session are no longer valid
    void flush()
    Flush changes, instances obtained within this session remain valid

    Methods inherited from class java.lang.Object

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

    • Session

      public Session()
      Creates new session
  • Method Details

    • add

      public void add​(AbstractMapper mapper)
      Adds a mapper to the session management
      Parameters:
      mapper - session-managed mapper instance
    • confirm

      public void confirm()
      Write-back any changes and close session, instances obtained within this session are no longer valid
    • flush

      public void flush()
      Flush changes, instances obtained within this session remain valid
    • discard

      public void discard()
      Discard any changes and close session, instances obtained within this session are no longer valid