Interface IPersistenceContext
-
- All Superinterfaces:
ch.ivyteam.ivy.scripting.IProjectSpecificClass
public interface IPersistenceContext extends ch.ivyteam.ivy.scripting.IProjectSpecificClassThe interface of the persistence attribute of the ivy variable. This interface offers anIIvyEntityManagerfor all the persistence units which are configured in the persistence configuration.- Since:
- 28.05.2009
- API:
- This is a public API.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static IPersistenceContextcurrent()Gets the current persistence context.IIvyEntityManagerget(String persistenceUnitName)Gets anIIvyEntityManagerfor managing entity classes of the persistence unit with the given name.
-
-
-
Method Detail
-
get
IIvyEntityManager get(String persistenceUnitName)
Gets anIIvyEntityManagerfor 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
IIvyEntityManagerfor 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.
-
-