Interface IPersistenceContext

  • All Superinterfaces:
    ch.ivyteam.ivy.scripting.IProjectSpecificClass

    public interface IPersistenceContext
    extends ch.ivyteam.ivy.scripting.IProjectSpecificClass
    The interface of the persistence attribute of the ivy variable. This interface offers an IIvyEntityManager for all the persistence units which are configured in the persistence configuration.
    Since:
    28.05.2009
    API:
    This is a public API.
    • Method Detail

      • get

        IIvyEntityManager get​(String persistenceUnitName)
        Gets an IIvyEntityManager for managing entity classes of the persistence unit with the given name.
        Parameters:
        persistenceUnitName - the name of the persistence unit which is used for loading the right persistence unit configuration
        Returns:
        an IIvyEntityManager for managing entity classes
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
      • current

        static IPersistenceContext current()

        Gets the current persistence context.

        Will return null if called out of scope. The scope is set if you call this method from an ivy process or any supported ivy environment. It is not set in non supported ivy environments (e.g. if you start your own threads, etc.).

        Returns:
        current persistence context or null if out of scope
        Since:
        9.1
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.