~peter-kovac11/play/play-scala-console-improvements

« back to all changes in this revision

Viewing changes to samples-and-tests/yabe-with-scala/app/models/User.java

  • Committer: guillaume
  • Date: 2009-11-11 17:19:54 UTC
  • Revision ID: guillaume@macbook-pro-de-guillaume.local-20091111171954-1z761dqr0aw93747
yabe-with-scala

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package models;
2
 
 
3
 
import java.util.*;
4
 
import javax.persistence.*;
5
 
 
6
 
import play.db.jpa.*;
7
 
import play.data.validation.*;
8
 
 
9
 
@Entity
10
 
public class User extends Model {
11
 
 
12
 
    @Email
13
 
    @Required
14
 
    public String email;
15
 
    
16
 
    @Required
17
 
    public String password;
18
 
    
19
 
    public String fullname;
20
 
    
21
 
    public boolean isAdmin;
22
 
    
23
 
    public User(String email, String password, String fullname) {
24
 
        this.email = email;
25
 
        this.password = password;
26
 
        this.fullname = fullname;
27
 
    }
28
 
    
29
 
    public static User connect(String email, String password) {
30
 
        return find("byEmailAndPassword", email, password).first();
31
 
    }
32
 
    
33
 
    public String toString() {
34
 
        return email;
35
 
    }
36
 
 
37
 
}
 
 
b'\\ No newline at end of file'