package org.mxchange.addressbook.model.addressbook.shared;
import java.text.MessageFormat;
+import java.util.Calendar;
import java.util.Objects;
+import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
import org.mxchange.addressbook.model.addressbook.Addressbook;
import org.mxchange.addressbook.model.addressbook.UserAddressbook;
import org.mxchange.jusercore.model.user.LoginUser;
@OneToOne (targetEntity = LoginUser.class, optional = false)
private User shareUserSharee;
+ /**
+ * When this share has been created
+ */
+ @Basic (optional = false)
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "share_created", nullable = false, updatable = false)
+ private Calendar shareCreated;
+
/**
* Default constructor for entity manager
*/
this.shareAddressbook = shareAddressbook;
}
+ @Override
+ public Calendar getShareCreated () {
+ return this.shareCreated;
+ }
+
+ @Override
+ public void setShareCreated (final Calendar shareCreated) {
+ this.shareCreated = shareCreated;
+ }
+
@Override
public Long getShareId () {
return this.shareId;
package org.mxchange.addressbook.model.addressbook.shared;
import java.io.Serializable;
+import java.util.Calendar;
import org.mxchange.addressbook.model.addressbook.Addressbook;
import org.mxchange.jusercore.model.user.User;
*/
void setShareUserSharee (final User shareUserSharer);
+ /**
+ * Getter for share creation timestamp
+ * <p>
+ * @return Share creation timestamp
+ */
+ Calendar getShareCreated ();
+
+ /**
+ * Setter for share creation timestamp
+ * <p>
+ * @param shareCreated Share creation timestamp
+ */
+ void setShareCreated (final Calendar shareCreated);
+
@Override
- boolean equals (final Object object);
+ boolean equals (final Object object);
@Override
- int hashCode ();
+ int hashCode ();
}