BrightSide Workbench Full Report + Source Code
org.turro.alliance.db.entities.AxCenter Class Reference
Inheritance diagram for org.turro.alliance.db.entities.AxCenter:
Collaboration diagram for org.turro.alliance.db.entities.AxCenter:

Public Member Functions

ProcedenceId getCenterId ()
 
void setCenterId (ProcedenceId centerId)
 
String getId ()
 
String getName ()
 
void setName (String name)
 
String getEmail ()
 
void setEmail (String email)
 
String getFace ()
 
void setFace (String face)
 
boolean isActive ()
 
void setActive (boolean active)
 
Iterable< AxStudentgetStudents ()
 
Iterable< String > getCourses ()
 
Object entityId ()
 
boolean isEmpty ()
 
String toJson ()
 
String toJson (Map< String, Object > properties)
 
int hashCode ()
 
boolean equals (Object obj)
 
- 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 ()
 

Static Public Member Functions

static AxCenter from (long memberId, String contactId)
 
static AxCenter from (long memberId, IContact contact)
 
static AxCenter fromJson (JsonValue value)
 

Detailed Description

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

Definition at line 42 of file AxCenter.java.

Member Function Documentation

◆ entityId()

Object org.turro.alliance.db.entities.AxCenter.entityId ( )

Implements org.turro.jpa.entity.IDaoEntity.

Definition at line 147 of file AxCenter.java.

147  {
148  return centerId;
149  }

◆ equals()

boolean org.turro.alliance.db.entities.AxCenter.equals ( Object  obj)

Definition at line 183 of file AxCenter.java.

183  {
184  if (this == obj) {
185  return true;
186  }
187  if (obj == null) {
188  return false;
189  }
190  if (getClass() != obj.getClass()) {
191  return false;
192  }
193  final AxCenter other = (AxCenter) obj;
194  return Objects.equals(this.centerId, other.centerId);
195  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ from() [1/2]

static AxCenter org.turro.alliance.db.entities.AxCenter.from ( long  memberId,
IContact  contact 
)
static

Definition at line 127 of file AxCenter.java.

127  {
128  if(contact.isValid()) {
129  AxCenter axc = new AxCenter();
130  ProcedenceId id = new ProcedenceId();
131  id.setMemberId(memberId);
132  id.setEntityId(contact.getId());
133  axc.setCenterId(id);
134  axc.setName(contact.getName());
135  axc.setEmail(contact.getEmail());
136  axc.setActive(!contact.isDeactivated());
137  String serverURL = ElephantContext.getServerUrl("http");
138  axc.setFace(Strings.isBlank(contact.getFace()) ? null : serverURL + contact.getFace());
139  return axc;
140  }
141  return null;
142  }
Here is the call graph for this function:

◆ from() [2/2]

static AxCenter org.turro.alliance.db.entities.AxCenter.from ( long  memberId,
String  contactId 
)
static

Definition at line 120 of file AxCenter.java.

120  {
121  if(!Strings.isBlank(contactId)) {
122  return from(memberId, Contacts.getContactById(contactId));
123  }
124  return null;
125  }
static AxCenter from(long memberId, String contactId)
Definition: AxCenter.java:120
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fromJson()

static AxCenter org.turro.alliance.db.entities.AxCenter.fromJson ( JsonValue  value)
static

Definition at line 169 of file AxCenter.java.

169  {
170  return IJSONizable.fromJson(value.toString(), AxCenter.class);
171  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCenterId()

ProcedenceId org.turro.alliance.db.entities.AxCenter.getCenterId ( )

Definition at line 54 of file AxCenter.java.

54  {
55  return centerId;
56  }

◆ getCourses()

Iterable<String> org.turro.alliance.db.entities.AxCenter.getCourses ( )

Definition at line 108 of file AxCenter.java.

108  {
109  return SqlClause.select("distinct c.course").from("AxStudent c")
110  .where().equal("c.center", name)
111  .and().equal("c.studentId.memberId", centerId.getMemberId())
112  .dao(new AlliancePU())
113  .stream(String.class)
114  .filter(s -> !Strings.isBlank(s))
115  .toList();
116  }

◆ getEmail()

String org.turro.alliance.db.entities.AxCenter.getEmail ( )

Definition at line 74 of file AxCenter.java.

74  {
75  return email;
76  }

◆ getFace()

String org.turro.alliance.db.entities.AxCenter.getFace ( )

Definition at line 82 of file AxCenter.java.

82  {
83  return face;
84  }

◆ getId()

String org.turro.alliance.db.entities.AxCenter.getId ( )

Definition at line 62 of file AxCenter.java.

62  {
63  return id;
64  }

◆ getName()

String org.turro.alliance.db.entities.AxCenter.getName ( )

Definition at line 66 of file AxCenter.java.

66  {
67  return name;
68  }

◆ getStudents()

Iterable<AxStudent> org.turro.alliance.db.entities.AxCenter.getStudents ( )

Definition at line 100 of file AxCenter.java.

100  {
101  return SqlClause.select("c").from("AxStudent c")
102  .where().equal("c.center", name)
103  .and().equal("c.studentId.memberId", centerId.getMemberId())
104  .dao(new AlliancePU())
105  .resultList(AxStudent.class);
106  }

◆ hashCode()

int org.turro.alliance.db.entities.AxCenter.hashCode ( )

Definition at line 176 of file AxCenter.java.

176  {
177  int hash = 7;
178  hash = 83 * hash + Objects.hashCode(this.centerId);
179  return hash;
180  }

◆ isActive()

boolean org.turro.alliance.db.entities.AxCenter.isActive ( )

Definition at line 90 of file AxCenter.java.

90  {
91  return active;
92  }

◆ isEmpty()

boolean org.turro.alliance.db.entities.AxCenter.isEmpty ( )

Implements org.turro.jpa.entity.IDaoEntity.

Definition at line 152 of file AxCenter.java.

152  {
153  return centerId.isEmpty() ||
154  Strings.isBlank(name);
155  }

◆ setActive()

void org.turro.alliance.db.entities.AxCenter.setActive ( boolean  active)

Definition at line 94 of file AxCenter.java.

94  {
95  this.active = active;
96  }
Here is the caller graph for this function:

◆ setCenterId()

void org.turro.alliance.db.entities.AxCenter.setCenterId ( ProcedenceId  centerId)

Definition at line 58 of file AxCenter.java.

58  {
59  this.centerId = centerId;
60  }
Here is the caller graph for this function:

◆ setEmail()

void org.turro.alliance.db.entities.AxCenter.setEmail ( String  email)

Definition at line 78 of file AxCenter.java.

78  {
79  this.email = email;
80  }
Here is the caller graph for this function:

◆ setFace()

void org.turro.alliance.db.entities.AxCenter.setFace ( String  face)

Definition at line 86 of file AxCenter.java.

86  {
87  this.face = face;
88  }
Here is the caller graph for this function:

◆ setName()

void org.turro.alliance.db.entities.AxCenter.setName ( String  name)

Definition at line 70 of file AxCenter.java.

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

◆ toJson() [1/2]

String org.turro.alliance.db.entities.AxCenter.toJson ( )

Definition at line 160 of file AxCenter.java.

160  {
161  return toJson(this);
162  }
Here is the caller graph for this function:

◆ toJson() [2/2]

String org.turro.alliance.db.entities.AxCenter.toJson ( Map< String, Object >  properties)

Definition at line 165 of file AxCenter.java.

165  {
166  return toJson(this, properties);
167  }
Here is the call graph for this function:

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