package org.mxchange.addressbook.model.addressbook;
import java.io.Serializable;
+import java.util.Calendar;
+import org.mxchange.addressbook.model.addressbook.status.AddressbokStatus;
+import org.mxchange.jusercore.model.user.User;
/**
* A POJI for addressbooks
*/
public void setAddressbookId (final Long addressbookId);
+ /**
+ * Getter for addressbook creation timestamp
+ * <p>
+ * @return Addressbook creation timestamp
+ */
+ public Calendar getAddressbookCreated ();
+
+ /**
+ * Setter for addressbook creation timestamp
+ * <p>
+ * @param addressbookCreated Addressbook creation timestamp
+ */
+ public void setAddressbookCreated (final Calendar addressbookCreated);
+
+ /**
+ * Getter for addressbook's name
+ * <p>
+ * @return Addressbook's name
+ */
+ public String getAddressbookName ();
+
+ /**
+ * Setter for addressbook's name
+ * <p>
+ * @param addressbookName Addressbook's name
+ */
+ public void setAddressbookName (final String addressbookName);
+
+ /**
+ * Getter for addressbook status
+ * <p>
+ * @return Addressbook status
+ */
+ public AddressbokStatus getAddressbookStatus ();
+
+ /**
+ * Setter for addressbook status
+ * <p>
+ * @param addressbookStatus Addressbook status
+ */
+ public void setAddressbookStatus (final AddressbokStatus addressbookStatus);
+
+ /**
+ * Getter for addressbook's user (owner)
+ * <p>
+ * @return Addressbook's user (owner)
+ */
+ public User getAddressbookUser ();
+
+ /**
+ * Setter for addressbook's user (owner)
+ * <p>
+ * @param addressbookUser Addressbook's user (owner)
+ */
+ public void setAddressbookUser (final User addressbookUser);
}
package org.mxchange.addressbook.model.addressbook;
import java.io.Serializable;
+import java.util.List;
import javax.ejb.Remote;
+import org.mxchange.jusercore.model.user.User;
/**
* A remote session interface for addressbook handling
*/
@Remote
public interface AddressbookSessionBeanRemote extends Serializable {
+
+ /**
+ * Some "getter" for a list of address books the logged-in user has created
+ * <p>
+ * @param loggedInUser Logged-in user
+ * @return List of all address books
+ */
+ public List<Addressbook> getUsersList (final User loggedInUser);
}
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
*/
@Entity (name = "addressbooks")
@Table (name = "addressbooks")
+@NamedQueries (
+ {
+ @NamedQuery (name = "AllUsersAddressbooks", query = "SELECT a FROM addressbooks AS a WHERE a.addressbookUser = :param ORDER BY a.addressbookId ASC")
+ }
+)
public class UserAddressbook implements Addressbook, Comparable<Addressbook> {
/**
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
+ @Override
+ public Calendar getAddressbookCreated () {
+ return this.addressbookCreated;
+ }
+
+ @Override
+ public void setAddressbookCreated (final Calendar addressbookCreated) {
+ this.addressbookCreated = addressbookCreated;
+ }
+
@Override
public Long getAddressbookId () {
return this.addressbookId;
this.addressbookId = addressbookId;
}
+ @Override
+ public String getAddressbookName () {
+ return this.addressbookName;
+ }
+
+ @Override
+ public void setAddressbookName (final String addressbookName) {
+ this.addressbookName = addressbookName;
+ }
+
+ @Override
+ public AddressbokStatus getAddressbookStatus () {
+ return this.addressbookStatus;
+ }
+
+ @Override
+ public void setAddressbookStatus (final AddressbokStatus addressbookStatus) {
+ this.addressbookStatus = addressbookStatus;
+ }
+
+ @Override
+ public User getAddressbookUser () {
+ return this.addressbookUser;
+ }
+
+ @Override
+ public void setAddressbookUser (final User addressbookUser) {
+ this.addressbookUser = addressbookUser;
+ }
}