A bunch of statics to support the repositories. this is also setup as repoUtilBean so that it gets injected with the ApplicationContext once its setup
Type Params | Return Type | Name and description |
---|---|---|
|
static void |
checkFound(GormEntity entity, Serializable id, String domainClassName) check that the passed in entity is not null and throws EntityNotFoundException if so |
|
static void |
checkVersion(GormEntity entity, Long oldVersion) checks the passed in version with the version on the entity (entity.version) make sure entity.version is not greater |
|
static void |
clear() clears the session cache |
|
static void |
clear(TransactionStatus status) |
|
static RepositoryApi |
findRepository(Class domainClass) |
|
static void |
flush() flushes the session |
|
static void |
flushAndClear() flushes the session and clears the session cache and the DomainClassGrailsPlugin.PROPERTY_INSTANCE_MAP |
|
static void |
flushAndClear(TransactionStatus status) |
<T> |
static RepositoryApi<T> |
getRepo(Class<T> domainClass) |
|
static String |
getRepoBeanName(Class domainClass) |
|
static String |
getRepoClassName(Class domainClass) |
|
static List<Class<RepositoryApi>> |
getRepositoryClasses() |
|
static void |
rollback() force a roll back if in a transaction |
check that the passed in entity is not null and throws EntityNotFoundException if so
entity
- - the domain object the checkid
- - the identifier use when trying to find it. Will be used to construct the exception messagedomainClassName
- - the name of the domain that will be used to build error message if thrownchecks the passed in version with the version on the entity (entity.version) make sure entity.version is not greater
entity
- the domain object the checkver
- the version this used to be (entity will have the )clears the session cache
flushes the session
flushes the session and clears the session cache and the DomainClassGrailsPlugin.PROPERTY_INSTANCE_MAP
force a roll back if in a transaction