/** * Transient getter for the associated Role * * @return returns primaryKey.getRole() */ @Transient public Role getRole() { return primaryKey.getRole(); }
/** @return Shortcut to primaryKey.getUser() */ @Transient public User getUser() { return primaryKey.getUser(); }
/** * @param user The User * @param role The Role */ public UserRole(User user, Role role) { Preconditions.checkNotNull(user, "user is required"); Preconditions.checkNotNull(role, "role is required"); primaryKey.setUser(user); primaryKey.setRole(role); }