19 package org.turro.alliance.db.entities;
21 import java.io.Serializable;
22 import java.util.Objects;
23 import javax.persistence.Embeddable;
24 import org.turro.string.Strings;
25 import org.turro.math.Zero;
26 import org.turro.util.Converter;
27 import org.turro.ws.WsMember;
28 import org.turro.ws.service.server.Clients;
37 private String mainEntityId;
38 private Long mainMemberId;
39 private String relatedEntityId;
40 private Long relatedMemberId;
47 this.mainEntityId = mainEntityId;
55 this.mainMemberId = mainMemberId;
59 return relatedEntityId;
63 this.relatedEntityId = relatedEntityId;
67 return relatedMemberId;
71 this.relatedMemberId = relatedMemberId;
77 this.mainEntityId = Converter.STANDARD.convert(mainEntityId, String.class);
81 this.relatedEntityId = Converter.STANDARD.convert(relatedEntityId, String.class);
87 return Strings.isBlank(mainEntityId) ||
Zero.
orNull(mainMemberId) ||
88 Strings.isBlank(relatedEntityId) ||
Zero.
orNull(relatedMemberId);
106 return Clients.getMember(mainMemberId);
110 return Clients.getMember(relatedMemberId);
116 hash = 79 * hash + Objects.hashCode(this.mainEntityId);
117 hash = 79 * hash + Objects.hashCode(this.mainMemberId);
118 hash = 79 * hash + Objects.hashCode(this.relatedEntityId);
119 hash = 79 * hash + Objects.hashCode(this.relatedMemberId);
131 if (getClass() != obj.getClass()) {
135 if (!Objects.equals(
this.mainEntityId, other.mainEntityId)) {
138 if (!Objects.equals(
this.relatedEntityId, other.relatedEntityId)) {
141 if (!Objects.equals(
this.mainMemberId, other.mainMemberId)) {
144 return Objects.
equals(this.relatedMemberId, other.relatedMemberId);
void setMemberId(Long memberId)
void setEntityId(String entityId)
Long getRelatedMemberId()
void setRelatedMemberId(Long relatedMemberId)
ProcedenceId getRelatedProcedenceId()
void setMainMemberId(Long mainMemberId)
void setRelatedEntityId(String relatedEntityId)
void setRelatedEntityId(Long relatedEntityId)
void setMainEntityId(Long mainEntityId)
String getRelatedEntityId()
ProcedenceId getMainProcedenceId()
void setMainEntityId(String mainEntityId)
boolean equals(Object obj)
WsMember getRelatedMember()
static boolean orNull(Number value)