Advertisement
Noah-Huppert

Scotch UserEmail Model v1

Nov 3rd, 2014
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. /**
  2.  * A users email
  3.  */
  4. @Entity
  5. public class UserEmail extends Model{
  6.     /**
  7.      * The user in which the email belongs to
  8.      */
  9.     @ManyToOne(cascade = CascadeType.ALL)
  10.     public User user;
  11.  
  12.     /**
  13.      * The email
  14.      */
  15.     @Constraints.Required
  16.     public String email;
  17.  
  18.     /* Constructors */
  19.  
  20.     /**
  21.      * Creates a new UserEmail
  22.      * @param email {@link models.UserEmail#email}
  23.      */
  24.     public UserEmail(String email){
  25.         this.email = email;
  26.     }
  27.  
  28.     /* Actions */
  29.     /**
  30.      * Used to query the database
  31.      */
  32.     public static Finder<Long, UserEmail> find = new Finder<Long, UserEmail>(Long.class, UserEmail.class);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement