import sample.service.Persons;
public class Application extends LoginWindow {
public void doLogin(String login, String password) {
Person user = Persons.queryByLogin(login, password);
// If we're running with empty database, create a transient user.
if (user == null && Database.query(Person.class).size() == 0) {
user = new Person();
user.setLogin(login);
user.setAdministrator(true);
}
if (user != null) {
Sessions.set(user);
show(new Navigation());
}