package de.terrestris.shogun2.service;

import org.springframework.stereotype.Service;

import de.terrestris.shogun2.model.User;

/**
 * Service class for the {@link User} model.
 * 
 * @author Nils Bühner
 * @see AbstractCrudService
 * 
 */
@Service("userService")
public class UserService extends AbstractExtDirectCrudService<User> {

}

@@ -29,24 +29,142 @@
 2.service;%0A%0A
+import java.util.List;%0A%0Aimport org.hibernate.criterion.Restrictions;%0Aimport org.hibernate.criterion.SimpleExpression;%0A
 import org.s
@@ -448,10 +448,339 @@
 ser%3E %7B%0A%0A
+%09/**%0A%09 * %0A%09 * @param accountName%0A%09 * @return%0A%09 */%0A%09public User findByAccountName(String accountName) %7B%0A%0A%09%09SimpleExpression eqAccountName = Restrictions.eq(%22accountName%22,%0A%09%09%09%09accountName);%0A%09%09List%3CUser%3E userList = dao.findByCriteria(eqAccountName);%0A%0A%09%09if (userList.size() == 1) %7B%0A%09%09%09return userList.get(0);%0A%09%09%7D%0A%0A%09%09return null;%0A%09%7D%0A%0A
 %7D%0A

Add findByUsername-method to userService.