SHARE
TWEET

Scotch User Model V1

Noah-Huppert Nov 3rd, 2014 137 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Holds User information
  3.  */
  4. @Entity
  5. public class User extends Model{
  6.     /**
  7.      * The users Id
  8.      */
  9.     @Id
  10.     public String userId;
  11.  
  12.     /**
  13.      * The users emails
  14.      */
  15.     @OneToMany(cascade = CascadeType.ALL)
  16.     @Constraints.Required
  17.     public List<UserEmail> emails;
  18.  
  19.     /* Constructors */
  20.     /**
  21.      * Creates a new user
  22.      * @param userId {@link models.User#userId}
  23.      * @param emails {@link models.User#emails}, if null an empty ArrayList will be created
  24.      */
  25.     public User(String userId, List<UserEmail> emails){
  26.         this.userId = userId;
  27.         this.emails = emails == null ? new ArrayList<>() : emails;
  28.     }
  29.  
  30.     /* Actions */
  31.     /**
  32.      * Used to query the database
  33.      */
  34.     public static Finder<Long, User> find = new Finder<Long, User>(Long.class, User.class);
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top