Module io.ebean.api
Package io.ebean.bean

Class PersistenceContext.WithOption

java.lang.Object
io.ebean.bean.PersistenceContext.WithOption
Enclosing interface:
PersistenceContext

public static class PersistenceContext.WithOption extends Object
Wrapper on a bean to also indicate if a bean has been deleted.

If a bean has been deleted then for the same persistence context is should not be able to be fetched from persistence context or L2 cache.

  • Field Details

    • DELETED

      public static final PersistenceContext.WithOption DELETED
      The bean was previously deleted from this persistence context (can't hit L2 cache).
  • Constructor Details

    • WithOption

      public WithOption(Object bean)
      The bean exists in the persistence context (and not been previously deleted).
  • Method Details

    • isDeleted

      public boolean isDeleted()
      Return true if the bean was deleted. This means you can't hit the L2 cache.
    • getBean

      public Object getBean()
      Return the bean (from the persistence context).