BrightSide Workbench Full Report + Source Code
org.turro.cleanup.DossierCleanup Class Reference
Inheritance diagram for org.turro.cleanup.DossierCleanup:
Collaboration diagram for org.turro.cleanup.DossierCleanup:

Public Member Functions

boolean isMine (Object entity)
 
void cleanEntity (Object entity, CleanupMode mode)
 
void cleanOrphans ()
 
- Public Member Functions inherited from org.turro.cleanup.AbstractCleanup
void setConsole (ICleanupConsole console)
 
void cleanFromCommons (String entityPath, CleanupMode mode, Set< Commons > commons)
 
Set< String > pathsForRoot (String root, Commons common)
 

Additional Inherited Members

- Protected Member Functions inherited from org.turro.cleanup.AbstractCleanup
ICleanupConsole getConsole ()
 
Set< String > getOrphans (Set< String > entities, Set< String > mapped)
 
void cleanOrphansFor (String root, Set< String > entities)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 35 of file DossierCleanup.java.

Member Function Documentation

◆ cleanEntity()

void org.turro.cleanup.DossierCleanup.cleanEntity ( Object  entity,
CleanupMode  mode 
)

Implements org.turro.cleanup.IElephantCleanup.

Definition at line 43 of file DossierCleanup.java.

43  {
44  if(entity instanceof Dossier dossier) {
45  String entityPath = DossierPU.getObjectPath(dossier);
46  Dao dao = new DossierPU();
47  cleanupIssues(dao, dossier, mode);
48  cleanupRequests(dao, dossier, mode);
49  getConsole().addMessage(dossier.getDescription());
50  Cleanup.executeForCommons(entityPath, getConsole(), mode, Set.of(Commons.values()));
51  CleanupAction.from("Removing DW...",
52  () -> DatawarehouseUtil.remove(dao, dossier))
53  .execute(getConsole(), mode);
54  CleanupAction.from("Deleting entity...",
55  () -> dao.deleteObject(dossier))
56  .execute(getConsole(), mode);
57  }
58  }
void addMessage(String message)
Here is the call graph for this function:

◆ cleanOrphans()

void org.turro.cleanup.DossierCleanup.cleanOrphans ( )

Reimplemented from org.turro.cleanup.AbstractCleanup.

Definition at line 80 of file DossierCleanup.java.

80  {
81  Dao dao = new DossierPU();
82  SqlClause.delete("Participant")
83  .where().isNull("dossier")
84  .dao(dao)
85  .execute();
86  SqlClause.delete("ParticipantRequest")
87  .where().isNull("dossier")
88  .dao(dao)
89  .execute();
90  SqlClause.delete("CategoryRequest")
91  .where().isNull("category")
92  .dao(dao)
93  .execute();
94  cleanOrphansFor("dossier", getEntityPaths(dao, Long.class, "Dossier", "id", "dossier"));
95  }
void cleanOrphansFor(String root, Set< String > entities)
Here is the call graph for this function:

◆ isMine()

boolean org.turro.cleanup.DossierCleanup.isMine ( Object  entity)

Implements org.turro.cleanup.IElephantCleanup.

Definition at line 38 of file DossierCleanup.java.

38  {
39  return entity instanceof Dossier;
40  }

The documentation for this class was generated from the following file: