Created
August 15, 2013 14:04
-
-
Save mdellavo/6241073 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface UserRelations { | |
@Relation(Score.class) | |
void getScores(QueryListener<Score> listener); | |
} | |
@Table(name="users") | |
public abstract static class User implements Entity, UserRelations { | |
public User() {} | |
@Column(primaryKey = true) | |
private long id = -1; | |
@Column(name="user_name", unique = true, nullable = false) | |
private String userName; | |
public User(final String name) { | |
userName = name; | |
} | |
public long getId() { | |
return id; | |
} | |
public String getUserName() { | |
return userName; | |
} | |
public void setUserName(final String username) { | |
userName = username; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment