better detection of empty database

This commit is contained in:
Athou
2014-08-11 05:33:00 +02:00
parent ff32b0e1c9
commit e8f0cfb4bd
2 changed files with 5 additions and 1 deletions

View File

@@ -48,7 +48,7 @@ public class StartupService implements Managed {
new UnitOfWork<Void>(sessionFactory) {
@Override
protected Void runInSession() throws Exception {
if (userDAO.findByName(CommaFeedApplication.USERNAME_ADMIN) == null) {
if (userDAO.count() == 0) {
initialData();
}
return null;