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

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 30 of file ContactsCleanup.java.

Member Function Documentation

◆ cleanEntity()

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

Implements org.turro.cleanup.IElephantCleanup.

Definition at line 38 of file ContactsCleanup.java.

38  {
39 
40  }

◆ cleanOrphans()

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

Reimplemented from org.turro.cleanup.AbstractCleanup.

Definition at line 43 of file ContactsCleanup.java.

43  {
44  Dao dao = new ContactsPU();
45  SqlClause.update("Convocation")
46  .append("set contact_fk = NULL")
47  .where().isNotNull("contact_fk")
48  .and().notExists(SqlClause.select("*").from("Contact c").where("c.identifier = contact_fk"))
49  .dao(dao)
50  .executeNative();
51  SqlClause.delete("CommentIt")
52  .where().isNotNull("creator_fk")
53  .and().notExists(SqlClause.select("*").from("Contact c").where("c.identifier = creator_fk"))
54  .dao(dao)
55  .executeNative();
56  SqlClause.delete("StarIt")
57  .where().isNotNull("creator_fk")
58  .and().notExists(SqlClause.select("*").from("Contact c").where("c.identifier = creator_fk"))
59  .dao(dao)
60  .executeNative();
61  SqlClause.delete("VoteIt")
62  .where().isNotNull("creator_fk")
63  .and().notExists(SqlClause.select("*").from("Contact c").where("c.identifier = creator_fk"))
64  .dao(dao)
65  .executeNative();
66  cleanOrphansFor("contact", getEntityPaths(dao, String.class, "Contact", "id", "contact"));
67  }
void cleanOrphansFor(String root, Set< String > entities)
Here is the call graph for this function:

◆ isMine()

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

Implements org.turro.cleanup.IElephantCleanup.

Definition at line 33 of file ContactsCleanup.java.

33  {
34  return false;
35  }

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