@Lob
private String activityMessage;
+ /**
+ * Principal name
+ */
+ @Column (name = "activity_principal_name", updatable = false)
+ private String activityPrincipalName;
+
/**
* Timestamp
*/
this.activityContactFamilyName = activityUser.getUserContact().getContactFamilyName();
}
+ /**
+ * Constructor with message, type, user, timestamp and principal name
+ * <p>
+ * @param activityMessage Message
+ * @param activityType Type
+ * @param activityUser User instance
+ * @param activityTimestamp imestamp
+ * @param principalName Principal name
+ */
+ public UserActivityLog (final String activityMessage, final String activityType, final User activityUser, final Calendar activityTimestamp, final String principalName) {
+ // Call other constructor
+ this(activityMessage, activityType, activityUser, activityTimestamp);
+
+ // Set principal name
+ this.activityPrincipalName = principalName;
+ }
+
@Override
public boolean equals (final Object object) {
if (this == object) {
if (!Objects.equals(this.getActivityMessage(), other.getActivityMessage())) {
return false;
+ } else if (!Objects.equals(this.getActivityPrincipalName(), other.getActivityPrincipalName())) {
+ return false;
} else if (!Objects.equals(this.getActivityType(), other.getActivityType())) {
return false;
} else if (!Objects.equals(this.getActivityId(), other.getActivityId())) {
this.activityMessage = activityMessage;
}
+ @Override
+ public String getActivityPrincipalName () {
+ return this.activityPrincipalName;
+ }
+
+ @Override
+ public void setActivityPrincipalName (final String activityPrincipalName) {
+ this.activityPrincipalName = activityPrincipalName;
+ }
+
@Override
@SuppressWarnings ("ReturnOfDateField")
public Calendar getActivityTimestamp () {
hash = 83 * hash + Objects.hashCode(this.getActivityId());
hash = 83 * hash + Objects.hashCode(this.getActivityMessage());
+ hash = 83 * hash + Objects.hashCode(this.getActivityPrincipalName());
hash = 83 * hash + Objects.hashCode(this.getActivityTimestamp());
hash = 83 * hash + Objects.hashCode(this.getActivityType());
hash = 83 * hash + Objects.hashCode(this.getActivityUser());