Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity(tableName = "users")
- public class UsersEntity{
- @PrimaryKey(autoGenerate = true)
- private long id;
- @NonNull
- private String name;
- @NonNull
- private long roleId;
- }
- @Entity(tableName = "roles")
- public class RolesEntity{
- @PrimaryKey(autoGenerate = true)
- private long id;
- @NonNull
- private String name;
- }
- public class User{
- private long id;
- private Role role;
- }
- user = userDao.getUser(userId)
- user.setRole(roleDao.getRole(user.getRoleId)
Add Comment
Please, Sign In to add comment