BrightSide Workbench Full Report + Source Code
org.turro.dossier.entity.DossierVersion Class Reference
Inheritance diagram for org.turro.dossier.entity.DossierVersion:
Collaboration diagram for org.turro.dossier.entity.DossierVersion:

Public Member Functions

boolean isActive ()
 
void setActive (boolean active)
 
Dossier getDossier ()
 
void setDossier (Dossier dossier)
 
Long getId ()
 
void setId (Long id)
 
Date getReleaseDate ()
 
void setReleaseDate (Date releaseDate)
 
String getVersionId ()
 
void setVersionId (String versionId)
 
Object entityId ()
 
boolean isEmpty ()
 
String getVersionString ()
 
long getIssues ()
 
DossierVersionStatus getStatus ()
 
List< String > getByStatus (DossierVersionStatus status)
 
int compareTo (DossierVersion o)
 
- Public Member Functions inherited from org.turro.jpa.entity.IDaoEntity
default boolean isNew ()
 
default void prepareSave ()
 
default void prepareDelete ()
 
default void removeEmpties ()
 
default Collection< Collection > collections ()
 

Detailed Description

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

Definition at line 42 of file DossierVersion.java.

Member Function Documentation

◆ compareTo()

int org.turro.dossier.entity.DossierVersion.compareTo ( DossierVersion  o)

Definition at line 193 of file DossierVersion.java.

193  {
194  return new Version(versionId).compareTo(new Version(o != null ? o.versionId : null));
195  }

◆ entityId()

Object org.turro.dossier.entity.DossierVersion.entityId ( )

Implements org.turro.jpa.entity.IDaoEntity.

Definition at line 102 of file DossierVersion.java.

102  {
103  return id;
104  }

◆ getByStatus()

List<String> org.turro.dossier.entity.DossierVersion.getByStatus ( DossierVersionStatus  status)

Definition at line 171 of file DossierVersion.java.

171  {
172  if(DossierVersionStatus.VERSION_STOPPED.equals(status)) {
173  return new DossierPU().getResultList(
174  "select concat('/issue/', id) from Issue issue " +
175  "where issue.version = ? " +
176  "and issue.status <> ? " +
177  "and issue.priority = ?",
178  new Object[] { this, IssueStatus.STATUS_CLOSED, IssuePriority.PRIORITY_CANT_CONTINUE }
179  );
180  } else if(DossierVersionStatus.VERSION_NOTRECOMMENDED.equals(status)) {
181  return new DossierPU().getResultList(
182  "select concat('/issue/', id) from Issue issue " +
183  "where issue.version = ? " +
184  "and issue.status <> ? " +
185  "and issue.priority = ?",
186  new Object[] { this, IssueStatus.STATUS_CLOSED, IssuePriority.PRIORITY_WORKAROUND_IMPRACTICAL }
187  );
188  }
189  return null;
190  }

◆ getDossier()

Dossier org.turro.dossier.entity.DossierVersion.getDossier ( )

Definition at line 67 of file DossierVersion.java.

67  {
68  return dossier;
69  }

◆ getId()

Long org.turro.dossier.entity.DossierVersion.getId ( )

Definition at line 75 of file DossierVersion.java.

75  {
76  return id;
77  }

◆ getIssues()

long org.turro.dossier.entity.DossierVersion.getIssues ( )

Definition at line 121 of file DossierVersion.java.

121  {
122  if(issueCount == null) {
123  issueCount = (Long) new DossierPU().getSingleResult(
124  "select count(issue) from Issue issue " +
125  "where issue.version = ?",
126  new Object[] { this }
127  );
128  }
129  return issueCount;
130  }
Here is the call graph for this function:

◆ getReleaseDate()

Date org.turro.dossier.entity.DossierVersion.getReleaseDate ( )

Definition at line 83 of file DossierVersion.java.

83  {
84  return releaseDate;
85  }

◆ getStatus()

DossierVersionStatus org.turro.dossier.entity.DossierVersion.getStatus ( )

Definition at line 132 of file DossierVersion.java.

132  {
133  if(currentStatus == null) {
134  long stoppers = (Long) new DossierPU().getSingleResult(
135  "select count(issue) from Issue issue " +
136  "where issue.version = ? " +
137  "and issue.status <> ? " +
138  "and issue.priority = ?",
139  new Object[] { this, IssueStatus.STATUS_CLOSED, IssuePriority.PRIORITY_CANT_CONTINUE }
140  );
141  if(stoppers > 0) {
142  currentStatus = DossierVersionStatus.VERSION_STOPPED;
143  } else {
144  long problematic = (Long) new DossierPU().getSingleResult(
145  "select count(issue) from Issue issue " +
146  "where issue.version = ? " +
147  "and issue.status <> ? " +
148  "and issue.priority = ?",
149  new Object[] { this, IssueStatus.STATUS_CLOSED, IssuePriority.PRIORITY_WORKAROUND_IMPRACTICAL }
150  );
151  if(problematic > 0) {
152  currentStatus = DossierVersionStatus.VERSION_NOTRECOMMENDED;
153  } else {
154  long onWork = (Long) new DossierPU().getSingleResult(
155  "select count(issue) from Issue issue " +
156  "where issue.version = ? " +
157  "and issue.status <> ?",
158  new Object[] { this, IssueStatus.STATUS_CLOSED }
159  );
160  if(onWork > 0) {
161  currentStatus = DossierVersionStatus.VERSION_ONWORK;
162  } else {
163  currentStatus = DossierVersionStatus.VERSION_READY;
164  }
165  }
166  }
167  }
168  return currentStatus;
169  }
Here is the call graph for this function:

◆ getVersionId()

String org.turro.dossier.entity.DossierVersion.getVersionId ( )

Definition at line 91 of file DossierVersion.java.

91  {
92  return versionId;
93  }
Here is the caller graph for this function:

◆ getVersionString()

String org.turro.dossier.entity.DossierVersion.getVersionString ( )

Definition at line 114 of file DossierVersion.java.

114  {
115  return "[" + versionId + Chars.forward().spaced().toString() + DateFormats.format(releaseDate, true) + "]";
116  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isActive()

boolean org.turro.dossier.entity.DossierVersion.isActive ( )

Definition at line 59 of file DossierVersion.java.

59  {
60  return active;
61  }

◆ isEmpty()

boolean org.turro.dossier.entity.DossierVersion.isEmpty ( )

Implements org.turro.jpa.entity.IDaoEntity.

Definition at line 107 of file DossierVersion.java.

107  {
108  return Strings.isBlank(versionId) ||
109  releaseDate == null;
110  }
Here is the caller graph for this function:

◆ setActive()

void org.turro.dossier.entity.DossierVersion.setActive ( boolean  active)

Definition at line 63 of file DossierVersion.java.

63  {
64  this.active = active;
65  }

◆ setDossier()

void org.turro.dossier.entity.DossierVersion.setDossier ( Dossier  dossier)

Definition at line 71 of file DossierVersion.java.

71  {
72  this.dossier = dossier;
73  }
Here is the caller graph for this function:

◆ setId()

void org.turro.dossier.entity.DossierVersion.setId ( Long  id)

Definition at line 79 of file DossierVersion.java.

79  {
80  this.id = id;
81  }

◆ setReleaseDate()

void org.turro.dossier.entity.DossierVersion.setReleaseDate ( Date  releaseDate)

Definition at line 87 of file DossierVersion.java.

87  {
88  this.releaseDate = releaseDate;
89  }

◆ setVersionId()

void org.turro.dossier.entity.DossierVersion.setVersionId ( String  versionId)

Definition at line 95 of file DossierVersion.java.

95  {
96  this.versionId = versionId;
97  }

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