public Login(User user, String username) { this(); if (username == null || username.equals("") || user == null) { throw new DomainException("error.empty.username.or.user"); } if (checkIfUsernameExists(username, this)) { throw new DomainException("error.existent.username"); } this.setUser(user); this.setUsername(username); this.setBeginDate(new DateTime());
public Login() { super();
    public Login(User user, String username) {        this();        if (username == null || username.equals("") || user == null) {            throw new DomainException("error.empty.username.or.user");        }        if (checkIfUsernameExists(username, this)) {            throw new DomainException("error.existent.username");        }        this.setUser(user);        this.setUsername(username);        this.setBeginDate(new DateTime());    }