class ProjectSpecificAnnotationsManager extends java.lang.Object implements TransactionalAction
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ProjectSpecificAnnotationsManager.AnnotationInfo
Holds some information about the annotation that
has been created.
|
Modifier and Type | Field and Description |
---|---|
private java.util.List<ProjectSpecificAnnotationsManager.AnnotationInfo> |
createdInherited |
private java.util.List<ProjectSpecificAnnotationsManager.AnnotationInfo> |
createdPrimary |
private java.util.Set<java.lang.Integer> |
deletedDefault |
private java.util.Set<java.lang.Integer> |
deletedPrimary |
private org.hibernate.query.Query<AnnotationData> |
findProjectSpecific |
private static boolean |
isDebugEnabled |
private static org.slf4j.Logger |
log |
private Session |
session |
Constructor and Description |
---|
ProjectSpecificAnnotationsManager(Session session) |
Modifier and Type | Method and Description |
---|---|
(package private) static int |
cleanupProjectSpecificAnnotations()
Delete project-specific annotations that belong to projects
that no longer exists.
|
(package private) void |
defaultDeleted(int id,
boolean isPrimary)
A default annotation is being deleted in this transaction.
|
(package private) int |
deleteAnnotationsForNonExistingProjects() |
(package private) Annotation |
findProjectSpecificAnnotation(Annotation defaultAnnotation,
int projectId)
Find a project-specific annotation for a given default annotation.
|
(package private) void |
inheritedCreated(int id,
int annotationSet,
int parent,
int parentSet,
int parentOverride,
int project)
An INHERITED/CLONED annotation has been created in this transaction.
|
void |
onAfterCommit()
Called after a successful commit.
|
void |
onBeforeCommit()
This method is called before the commit is about to happen.
|
void |
onRollback()
Called after an unsuccessful commit.
|
(package private) void |
primaryCreated(int id,
int annotationSet,
int annotationType,
int project)
A PRIMARY annotation has been created in this transaction.
|
private static final org.slf4j.Logger log
private static final boolean isDebugEnabled
private final Session session
private final java.util.Set<java.lang.Integer> deletedDefault
private final java.util.Set<java.lang.Integer> deletedPrimary
private final java.util.List<ProjectSpecificAnnotationsManager.AnnotationInfo> createdPrimary
private final java.util.List<ProjectSpecificAnnotationsManager.AnnotationInfo> createdInherited
private org.hibernate.query.Query<AnnotationData> findProjectSpecific
ProjectSpecificAnnotationsManager(Session session)
static int cleanupProjectSpecificAnnotations() throws BaseException
BaseException
Annotation findProjectSpecificAnnotation(Annotation defaultAnnotation, int projectId)
void primaryCreated(int id, int annotationSet, int annotationType, int project)
id
- The annotation that was createdannotationSet
- The annotation set the annotation belongs toannotationType
- The annotation type of the annotationproject
- The id of the project, or 0 for default annotationvoid inheritedCreated(int id, int annotationSet, int parent, int parentSet, int parentOverride, int project)
id
- The annotation that was createdannotationSet
- The annotation set the annotation belongs toparent
- The id of the parent annotationparentSet
- The id of the parent annotation setparentOverride
- The "override_id" column from the parent annotationproject
- The id of the project, or 0 for default annotationvoid defaultDeleted(int id, boolean isPrimary)
public void onBeforeCommit()
TransactionalAction
onBeforeCommit
in interface TransactionalAction
public void onAfterCommit()
TransactionalAction
onAfterCommit
in interface TransactionalAction
public void onRollback()
TransactionalAction
onRollback
in interface TransactionalAction
int deleteAnnotationsForNonExistingProjects()