Class JaloSession

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CommerceJaloSession, LDAPJaloSession, SessionTest.MySession

public class JaloSession extends AbstractJaloSession
The JaloSession is the central class for storing all session informations.

It is used for

  • getting Managers
  • getting/setting SessionContext objects
  • posting events and registering EventListeners
  • identifying items by their PKs.
See Also:
  • Field Details

  • Constructor Details

    • JaloSession

      public JaloSession()
  • Method Details

    • getTenant

      public <T extends Tenant> T getTenant()
    • assureSessionNotStale

      public static boolean assureSessionNotStale(JaloSession session)
      Returns:
      false whenever given JaloSession has not exactly the same tenantRestartMarker with the Tenant which is referenced by this JaloSession.
    • isTenantNotAccessible

      public static boolean isTenantNotAccessible(AbstractTenant tenant)
    • init

      protected void init()
      Overwrite this class for special initialization logic.
    • createSessionContext

      protected SessionContext createSessionContext(SessionContext original)
      Creates a new SessionContext instance setting given context as original. Overwrite this method to change implementation to use for SessionContext.
      Since:
      4.2
    • isDefaultAnonymous

      protected boolean isDefaultAnonymous(Map props)
    • initSessionContext

      protected void initSessionContext(Map props) throws JaloSecurityException
      Throws:
      JaloSecurityException
    • initUser

      protected User initUser(Map props, boolean isDefaultAnonymousSession) throws JaloSecurityException
      Throws:
      JaloSecurityException
    • createSessionID

      protected String createSessionID()
      creates a session ID for a newly created session. currently this is done by creating a new PK of the session typecode.

      override this method to create own session ids.

      Returns:
      the session id string
    • getInitialSessionLanguage

      protected Language getInitialSessionLanguage(User user)
    • getInitialSessionCurrency

      protected Currency getInitialSessionCurrency(User user)
    • generateLoginTokenCookieValue

      public String generateLoginTokenCookieValue() throws EJBPasswordEncoderNotFoundException
      Generates a value entry for a CookieBasedLoginToken instance, which will be used by some web apps (like printcockpit, hmc, ...) for an 'auto' login process
      Returns:
      the generated token. format: ${session.user PK}${session.language PK}${session.user.password} (sample: 11326704420716009013969790041776ee10c315eba2c75b403ea79136f5b38d)
      Throws:
      EJBPasswordEncoderNotFoundException
    • generateLoginTokenCookieValue

      public String generateLoginTokenCookieValue(String iso) throws EJBPasswordEncoderNotFoundException
      Generates a value entry for a CookieBasedLoginToken instance, which will be used by some web apps (like printcockpit, hmc, ...) for an 'auto' login process
      Parameters:
      iso - language
      Returns:
      the generated token. format: ${session.user PK}${session.language PK}${session.user.password} (sample: 11326704420716009013969790041776ee10c315eba2c75b403ea79136f5b38d)
      Throws:
      EJBPasswordEncoderNotFoundException
    • storeLoginTokenCookie

      public void storeLoginTokenCookie(javax.servlet.http.HttpServletResponse response) throws EJBPasswordEncoderNotFoundException
      Generates and stores a CookieBasedLoginToken instance, for the current session user ('auto' login process)
      Throws:
      EJBPasswordEncoderNotFoundException
    • performLogin

      protected User performLogin(LoginToken token, Map loginProperties) throws JaloSecurityException
      performs login for a given login token and additionally params. the method must return an existing user item - otherwise the session creation process will report an error.

      this method is called during session creation and session transfer.

      subclasses may override this method to implement own user search and/or login check behaviour.

      Parameters:
      token - login token
      loginProperties - logging properties ( see JaloSession.LoginProperties )
      Returns:
      the user which is associated with this newly created session
      Throws:
      JaloSecurityException
    • performLogin

      protected User performLogin(String login, String password, Map loginProperties) throws JaloSecurityException
      performs login for a given login, password and additionally params. the method must return an existing user item - otherwise the session creation process will report an error.

      this method is called during session creation and session transfer.

      subclasses may override this method to implement own user search and/or login check behaviour.

      Parameters:
      login - user's login
      password - user's password
      loginProperties - logging properties ( see JaloSession.LoginProperties )
      Returns:
      the user which is associated with this newly created session
      Throws:
      JaloSecurityException
    • isAnonymousAndAnonymousLoginIsDisabled

      protected boolean isAnonymousAndAnonymousLoginIsDisabled(String login)
      Tells whether this is the anonymous account and anonymous login is disallowed ( using the login.anonymous.always.disabled configuration parameter ).
    • isNotAnonymousOrAnonymousLoginIsAllowed

      protected boolean isNotAnonymousOrAnonymousLoginIsAllowed(String login)
      Tells whether this is not anonymous account or anonymous login is allowed by setting login.anonymous.always.disabled configuration parameter to false.
    • findSessionUserType

      protected ComposedType findSessionUserType(String sessionTypeString) throws JaloInvalidParameterException
      Throws:
      JaloInvalidParameterException
    • findSessionUser

      protected User findSessionUser(ComposedType userType, String login) throws JaloSecurityException, JaloInvalidParameterException
      Throws:
      JaloSecurityException
      JaloInvalidParameterException
    • activate

      public void activate()
      Set the given JaloSession as the active session for the current thread.

      It is very important not to forget this. It can be not guaranteed that you can access objects that belongs to a 'not activated' session.

      This always ensures that you have no problems accessing the jalo objects. This method is automatically called e.g. when using WebSessionFunctions.getSession() to get a session.

    • deactivate

      public static void deactivate()
      remove the active session from the current thread.

    • setLastAccessed

      protected void setLastAccessed(long accessed)
    • getCreationTime

      public long getCreationTime()
      Returns:
      the creationTime
    • getLastAccessed

      public long getLastAccessed()
      Returns:
      the lastAccessed
    • getCurrentSession

      public static JaloSession getCurrentSession()
      Returns the active session for the current thread and tenant

      If none is available, a new anonymous session will be created.

      Returns:
      the current session
      Throws:
      IllegalStateException - in case no tenant is active
    • getCurrentSession

      public static JaloSession getCurrentSession(Tenant tenant)
    • checkSessionValidity

      protected void checkSessionValidity()
      returns false if session is already closed()
    • touch

      public void touch()
      mark this session as used. The timeout is being reset. See also the setTimeout(), getTimeout() and isExpired()
      Since:
      3.0
    • getTimeout

      @Deprecated(since="5.5.1", forRemoval=false) public int getTimeout()
      Deprecated.
      since 5.5.1 session management was changed and this method always return -1
      get the timeout in seconds. If the timeout is 0 or less the session will never expire.
      Returns:
      the timeout in seconds
      Since:
      3.0
    • setTimeout

      @Deprecated(since="5.5.1", forRemoval=false) public void setTimeout(int seconds)
      Deprecated.
      since 5.5.1 session management was changed and this method has no effect
      set the timeout in seconds. If 0 or less is specified, the session will never expire.
      Parameters:
      seconds - the timeout in seconds
      Since:
      3.0
    • setTimeoutInMillis

      @Deprecated(since="5.5.1", forRemoval=false) public void setTimeoutInMillis(long timeOutInMillis)
      Deprecated.
      since 5.5.1 session management was changed and this method has no effect
      Set the timeout in milliseconds! Same as setTimeout(int) but expects the timeout in milliseconds here! If 0 or less is specified, the session will never expire.
      Parameters:
      timeOutInMillis - the time out of the session in milli seconds
      Since:
      4.5
    • isExpired

      @Deprecated(since="5.5.1", forRemoval=false) public boolean isExpired()
      Deprecated.
      since 5.5.1 session management was changed and this method always return false
      checks whether the current session is expired. if the timeout was set to 0 seconds or less, the session will never expire
      Since:
      3.0
    • getDefaultSessionTimeout

      protected int getDefaultSessionTimeout()
      returns the default session timeout in seconds which will be assigned to a new session if it is created The default implementation returns the value of the "default.session.timeout" configuration parameter or '86400' if not set (that is 1 day). this method can be overridden by subclasses.
      Since:
      3.0
    • internalGetCurrentSession

      public static JaloSession internalGetCurrentSession()
      Returns the active session for the current thread.

      If none is available NULL is returned

      Returns:
      the JaloSession or null
    • hasCurrentSession

      public static boolean hasCurrentSession()
      Helper method for testing if the current thread has an active session.

      The advantage of calling this method instead of getCurrentSession() is that you do not have to catch an Exception.

      Returns:
      true if the current thread has an active session (that is not already closed()), false otherwise
    • hasCurrentSession

      public static boolean hasCurrentSession(Tenant tenant)
    • getUser

      public User getUser()
      Returns the user which is currently associated with this session.
      Returns:
      the user which is currently associated with this session
    • setUser

      public void setUser(User user)
      Changes the session user without any login processing. Further the session cart is assigned to the new user.
      Parameters:
      user - the new user
    • transfer

      public void transfer(Map props) throws JaloSecurityException, JaloInvalidParameterException
      changes the session user including the full login process. any settings made to this session are kept except that the session cart is assigned to the new session user. The default language and currency will not be set for the new user. Therefore use transfer(Map props, boolean activateUserLanguageAndCurrency) with last parameter = true.
      Parameters:
      props - logging properties ( see JaloSession.LoginProperties )
      Throws:
      JaloSecurityException - in case login process failed
      JaloInvalidParameterException - in case some provided parameter had an unexpected value
    • transfer

      public void transfer(String user, String pwd) throws JaloSecurityException
      changes the session user including the full login process. any settings made to this session are kept except that the session cart is assigned to the new session user. The default language and currency will not be set for the new user. Therefore use transfer(Map props, boolean activateUserLanguageAndCurrency) with last parameter = true.
      Parameters:
      user - the new user
      pwd - the password of the user
      Throws:
      JaloSecurityException - in case login process failed
    • transfer

      public void transfer(Map props, boolean activateUserLanguageAndCurrency) throws JaloSecurityException, JaloInvalidParameterException
      changes the session user including the full login process. any settings made to this session are kept except that the session cart is assigned to the new session user. if specified the session language and session currency is changed to the values belonging to the new user ( see GeneratedUser.getSessionLanguage() and GeneratedUser.getSessionCurrency() ). Set the Boolean activateUserLanguageAndCurrency to true if you want the new user to use his / her default language and currency. If set to false, the new user will have the language and currency used by the former user.
      Parameters:
      props - logging properties ( see JaloSession.LoginProperties )
      activateUserLanguageAndCurrency - if true the session language and session currency are set to the values set at the new user
      Throws:
      JaloSecurityException - in case login process failed
      JaloInvalidParameterException - in case some provided parameter had an unexpected value
    • getLoginToken

      protected LoginToken getLoginToken(Map props)
    • getCart

      public Cart getCart()
      Returns the cart which is currently associated with this session. if no cart is available at this time, a new one is created.
      Returns:
      the cart which is currently associated with this session
    • getAttachedCart

      protected Cart getAttachedCart()
    • setAttachedCart

      protected void setAttachedCart(Cart cart)
    • createCart

      protected Cart createCart()
      Used by getCart() to create a new cart.
      Returns:
      the new Cart
    • getCartType

      protected ComposedType getCartType()
      Provides composed type for newly created cart. Fetches type from either session context (first) or configuration (second). If no type has been specified it returns null.
    • doCreateCart

      protected Cart doCreateCart(ComposedType cartType, User user, Currency curr, Date date, boolean isNet)
    • hasCart

      public boolean hasCart()
    • removeCart

      public void removeCart()
      Removes a cart from the current session and database, if the Item.remove() fails it is always clearing the internal reference.
    • setCart

      public void setCart(Cart cart)
    • restoreSavedCart

      public void restoreSavedCart(Cart savedCart)
      Restores all entries from a saved cart to the session cart, thereby removes currently existing entries.
      Parameters:
      savedCart -
    • appendSavedCart

      public void appendSavedCart(Cart appendCart)
      Appends the entries from the saved cart to the session cart.
      Parameters:
      appendCart -
    • getLoginProperties

      public Map getLoginProperties()
      returns the properties that was used to create this session.

      When creating a session with JaloConnection.createSession() you have to specify a map with user informations.

      This method returns this 'login-information' map.

      Returns:
      the properties that were used to create this session
    • setLoginProperties

      protected void setLoginProperties(Map loginProperties)
    • setAttributes

      public void setAttributes(Map attributes)
      Replaces multiple session attributes at once. Please note that previously stored attributes are not removed if their keys are not included in the new map.
      Parameters:
      attributes - the attributes to store
    • getAttributes

      public Map getAttributes()
      Returns the attribute map of the session context.
      Returns:
      the attribute map of the current session context
    • getAttribute

      public Object getAttribute(String name)
      Returns the value of the attribute with the specified name from the attribute map of the current session context.
      Parameters:
      name - of the attribute
      Returns:
      the value of the attribute specified in the parameter name
    • setAttribute

      public Object setAttribute(String name, Object value)
      Sets a new value for the attribute with the specified name in the attribute map of the current session context.
      Parameters:
      name - of the attribute
      value - the new value
      Returns:
      the old value of the attribute specified in the parameter name
    • getAttributeNames

      public Enumeration getAttributeNames()
      Returns an Enumeration of String objects containing the names of all the objects bound to this session.
      Returns:
      an Enumeration of String objects containing the names of all the objects bound to this session.
    • removeAttribute

      public Object removeAttribute(String name)
      Removes the specified attribute from the attribute map of the current session context.
      Parameters:
      name - of the attribute, which should be removed
      Returns:
      the value of the removed attribute
    • getAccessManager

      public AccessManager getAccessManager()
      returns the AccessManager.
      Returns:
      the AccessManager object
    • getUserManager

      public UserManager getUserManager()
      returns the UserManager.
      Returns:
      the UserManager object
    • getProductManager

      public ProductManager getProductManager()
      returns the ProductManager.
      Returns:
      the ProductManager object
    • getNumberSeriesManager

      public NumberSeriesManager getNumberSeriesManager()
      returns the NumberSeriesManager.
      Returns:
      the NumberSeriesManager object
    • getFlexibleSearch

      public FlexibleSearch getFlexibleSearch()
      returns the FlexibleSearch.
      Returns:
      the FlexibleSearch object
    • getC2LManager

      public C2LManager getC2LManager()
      returns the C2LManager.
      Returns:
      the C2LManager object
    • getMetaInformationManager

      public MetaInformationManager getMetaInformationManager()
      returns the MetaInformationManager.
      Returns:
      the MetaInformationManager object
    • getMediaManager

      public MediaManager getMediaManager()
      returns the MediaManager.
      Returns:
      the MediaManager object
    • getOrderManager

      public OrderManager getOrderManager()
      returns the OrderManager.
      Returns:
      the OrderManager object
    • getLinkManager

      public LinkManager getLinkManager()
      returns the LinkManager.
      Returns:
      the LinkManager object
    • getExtensionManager

      public ExtensionManager getExtensionManager()
      returns the ExtensionManger.
      Returns:
      the ExtensionManager object
    • getTypeManager

      public TypeManager getTypeManager()
      returns the TypeManager.
      Returns:
      the TypeManager object
    • getEnumerationManager

      public EnumerationManager getEnumerationManager()
      return the enumeration manager
      Returns:
      the EnumerationManager object
    • getSessionContext

      public SessionContext getSessionContext()
      Returns the SessionContext currently bound to this session.

      All changes in this SessionContext will directly modify the session's context.

      You can use the following code fragment to change the session language:

       SessionContext ctx = jaloSession.getSessionContext();
       ctx.setLanguage(xy);
       
      .
      Returns:
      the SessionContext object
    • getLocalSessionContext

      protected SessionContext getLocalSessionContext()
    • addLocalSessionContext

      protected void addLocalSessionContext(SessionContext localCtx)
    • createSessionContext

      public SessionContext createSessionContext()
      Returns a SessionContext which is filled with the current session settings but is NOT bound to the session.

      This means you can change the returned SessionContext object without reflecting these changes into the session.

      Returns:
      the SessionContext object
    • createLocalSessionContext

      public SessionContext createLocalSessionContext()
      creates a new session context which hides this session's current context within the current thread until it is disabled via removeLocalSessionContext(). since createLocalSessionContext may be called multiple time the now visible context might be a local context too.

      please note that any changes made on this sessions context will not pass through to the original context and therefore will be lost after disabling the local context.

      the saves way to use local session context requires finally blocks:

       try
       {
              SessionContext myLocalCtx = JaloSession.getCurrentSession().createLocalSessionContext();
              myLocalCtx.setAttribute("specialForThisThreadOnly", myValue);
              // do whatever in this context should be done
       }
       finally
       {
              JaloSession.getCurrentSession().removeLocalSessionContext();
       }
       
      Returns:
      the new (thread)local session context
    • createLocalSessionContext

      public SessionContext createLocalSessionContext(SessionContext original)
    • removeLocalSessionContext

      public void removeLocalSessionContext()
      removes the (thread)local session context associated with this session so that the previous session context is visible again. since createLocalSessionContext() may be called multiple time the now visible context might be a local context too.
    • removeAllLocalSessionContexts

      protected void removeAllLocalSessionContexts()
    • createSearchContext

      public SearchContext createSearchContext()
      Returns a SearchContext object which is used for Search operations.
      Returns:
      a SearchContext object
    • lookupItem

      public static <T extends Item> T lookupItem(PK pk) throws JaloItemNotFoundException
      Same as getItem(PK) but without actually requiring a session instance.
      Throws:
      JaloItemNotFoundException
    • lookupItem

      public static <T extends Item> T lookupItem(Tenant tenant, PK pk) throws JaloItemNotFoundException
      Same as lookupItem(PK) with the ability to pass the (required) tenant manually.
      Throws:
      JaloItemNotFoundException
    • lookupItems

      public static Collection<? extends Item> lookupItems(SessionContext ctx, Collection<PK> pks) throws JaloItemNotFoundException
      Same as getItems(SessionContext, Collection) but without requiring a jalo session instance.
      Throws:
      JaloItemNotFoundException
    • lookupItems

      public static Collection<? extends Item> lookupItems(SessionContext ctx, Collection<PK> pks, boolean ignoreMissingItems) throws JaloItemNotFoundException
      Same as getItems(SessionContext, Collection, boolean) but without requiring a jalo session instance.
      Throws:
      JaloItemNotFoundException
    • lookupItems

      public static Collection<? extends Item> lookupItems(SessionContext ctx, Collection<PK> pks, boolean ignoreMissingItems, boolean returnMissingAsNull) throws JaloItemNotFoundException
      Same as getItems(SessionContext, Collection, boolean, boolean) but without requiring a jalo session instance.
      Throws:
      JaloItemNotFoundException
    • lookupItems

      public static Collection<? extends Item> lookupItems(Tenant tenant, SessionContext ctx, Collection<PK> pks, boolean ignoreMissingItems, boolean returnMissingAsNull) throws JaloItemNotFoundException
      Throws:
      JaloItemNotFoundException
    • getItem

      public <T extends Item> T getItem(PK pk) throws JaloItemNotFoundException
      returns the item with the given PK.
      Parameters:
      pk - the primary key object of the item
      Returns:
      the Item, if found
      Throws:
      JaloItemNotFoundException - if the item could not be found in the system
    • getItem

      @Deprecated(since="ages", forRemoval=false) public <T extends Item> T getItem(String pk) throws JaloItemNotFoundException, IllegalArgumentException
      Deprecated.
      since ages - please usegetItem(PK) with PK.parse(String)
      returns the item with the given PK.
      Parameters:
      pk - the item primary key as string representation ( see PK.toString() )
      Returns:
      the item if found
      Throws:
      JaloItemNotFoundException - in case no item can be found
      IllegalArgumentException - in case the string is no valid PK representation
    • getItems

      public Collection<? extends Item> getItems(Collection<PK> pks) throws JaloItemNotFoundException
      Returns a collection of items for a given collection of PKs.

      Use this method for example, if you transfer PKs via GET/POST request from one JSP page to another and then want to 'reincarnate' the item.

      Parameters:
      pks - the primary key collection
      Returns:
      a collection containing Item instances
      Throws:
      JaloItemNotFoundException - if one item could not be found in the system
    • getItems

      public Collection<? extends Item> getItems(SessionContext ctx, Collection<PK> pks) throws JaloItemNotFoundException
      Returns a collection of items for a given collection of PKs.

      Use this method for example, if you transfer PKs via GET/POST request from one JSP page to another and then want to 'reincarnate' the item.

      Parameters:
      ctx - the session context to define advanced settings like data prefetching
      pks - the primary key collection
      Returns:
      a collection containing Item instances
      Throws:
      JaloItemNotFoundException - if one item could not be found in the system
    • getItems

      public Collection<? extends Item> getItems(SessionContext ctx, Collection<PK> pks, boolean ignoreMissingItems) throws JaloItemNotFoundException
      Returns a collection of items for a given collection of PKs.

      Use this method for example, if you transfer PKs via GET/POST request from one JSP page to another and then want to 'reincarnate' the item.

      Parameters:
      ctx - the session context to define advanced settings like data pre-fetching
      pks - the primary key collection
      ignoreMissingItems - if true invalid item PKs are simply ignored and omitted from the result collection
      Returns:
      a collection containing Item instances
      Throws:
      JaloItemNotFoundException - if one item could not be found in the system unless ignoreMissingItems is true
    • getItems

      public Collection<? extends Item> getItems(SessionContext ctx, Collection<PK> pks, boolean ignoreMissingItems, boolean returnMissingAsNull) throws JaloItemNotFoundException
      Returns a collection of items for a given collection of PKs.

      Use this method for example, if you transfer PKs via GET/POST request from one JSP page to another and then want to 'reincarnate' the item.

      Parameters:
      ctx - the session context to define advanced settings like data pre-fetching
      pks - the primary key collection
      ignoreMissingItems - if true invalid item PKs are simply ignored and omitted from the result collection
      returnMissingAsNull - if true when ignoring missing items all non-existent PKs will be returned as NULL within the result collection - otherwise the missing PK is filtered completely
      Returns:
      a collection containing Item instances
      Throws:
      JaloItemNotFoundException - if one item could not be found in the system unless ignoreMissingItems is true
    • getSessionID

      public String getSessionID()
      Returns the session ID. The session id is a generated unique string.

      Returns:
      the session id
    • toString

      public String toString()
      returns a String representation which contains the SessionID and the UserID which is currently assigned to this Session.
      Overrides:
      toString in class Object
      Returns:
      the string representation of this session
    • isClosed

      public boolean isClosed()
      returns true if this session is closed.
      Returns:
      true if this session is closed.
    • close

      public void close()
      Closes this session.

      After closing a session is cannot be guaranteed that you can access items or manager belonging to this session.

      You should call this method if you do not need this session anymore, because all reserved resources will be freed.

    • cleanup

      protected void cleanup()
    • isRemoveCartOnSessionClose

      protected boolean isRemoveCartOnSessionClose()
    • createPropertyContainer

      public JaloPropertyContainer createPropertyContainer()
      Create a new property container that can be used for mass property updates.
      Returns:
      the new property container
      See Also:
    • getHttpSession

      @Deprecated(since="5.5.1", forRemoval=false) public javax.servlet.http.HttpSession getHttpSession()
      Deprecated.
      since 5.5.1 session management was changed and this method always returns null
      returns the HttpSession, which is currently associated to this jalo session.

      can be null. A HttpSession is automatically associated if this session is created via WebSessionFunctions.getSession(..)

      Returns:
      the HttpSession
    • setHttpSessionId

      public void setHttpSessionId(String httpSessionId)
      Stores a http session id inside this session.
    • getHttpSessionId

      public String getHttpSessionId()
    • search

      public SearchResult search(GenericQuery query, SearchContext ctx)
      Initiates a search with the given GenericQuery and SearchContext.
      Parameters:
      query - A GenericQuery instance that specifies your search query.
      ctx - Besides standard evaluation of SearchContext, following custom properties are considered valid: GenericSearchConstants.DONT_NEED_TOTAL -> default is true.
      Returns:
      SearchResult
    • search

      public SearchResult search(GenericQuery query)
    • setPriceFactory

      public void setPriceFactory(PriceFactory factory)
    • getPriceFactory

      public PriceFactory getPriceFactory()
    • search

      public SearchResult search(GenericQuery genericQuery, Principal principal, SearchContext searchCtx)
      Initiates a search with the given GenericQuery and SearchContext.
      Parameters:
      genericQuery - A GenericQuery instance that specifies your search query.
      principal - A Principal instance for restriction evaluation.
      searchCtx - Besides standard evaluation of SearchContext, following custom properties are considered valid: GenericSearchConstants.DONT_NEED_TOTAL -> default is true.
      Returns:
      SearchResult
    • notifyExtensionsBeforeSessionClose

      protected void notifyExtensionsBeforeSessionClose()
    • equals

      public final boolean equals(Object object)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(Object object)
      Implements item comparison by PK. Subclasses may override this.
      Parameters:
      object - which will be compared to this item.
      Returns:
      the value 0 if the argument item pk is equal to this item pk; a value less than 0 if this item pk is lexicographically less than the argument item pk; and a value greater than 0 if this item pk is lexicographically greater than the argument item pk.
    • hashCode

      public final int hashCode()
      Returns the hashcode of this JaloSession

      The hashcode of an item is defined as the hashcode of its primary key object.

      Overrides:
      hashCode in class Object
      Returns:
      the hashcode of this item.