Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Holds User information
- */
- @Entity
- public class User extends Model{
- /**
- * The users Id
- */
- @Id
- public String userId;
- /**
- * The users emails
- */
- @OneToMany(cascade = CascadeType.ALL)
- @Constraints.Required
- public List<UserEmail> emails;
- /* Constructors */
- /**
- * Creates a new user
- * @param userId {@link models.User#userId}
- * @param emails {@link models.User#emails}, if null an empty ArrayList will be created
- */
- public User(String userId, List<UserEmail> emails){
- this.userId = userId;
- this.emails = emails == null ? new ArrayList<>() : emails;
- }
- /* Actions */
- /**
- * Used to query the database
- */
- public static Finder<Long, User> find = new Finder<Long, User>(Long.class, User.class);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement