Added 'heavyduty' sample to sandbox for testing
This commit is contained in:
27
sandbox/heavyduty/src/main/java/sample/dao/impl/UserDAOImpl.java
Executable file
27
sandbox/heavyduty/src/main/java/sample/dao/impl/UserDAOImpl.java
Executable file
@@ -0,0 +1,27 @@
|
||||
package sample.dao.impl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import sample.domain.User;
|
||||
|
||||
/**
|
||||
* UserDAOImpl
|
||||
*/
|
||||
@Repository
|
||||
public class UserDAOImpl extends GenericDAOImpl<User, Long> implements
|
||||
sample.dao.UserDAO {
|
||||
|
||||
/**
|
||||
* Required constructor
|
||||
*/
|
||||
public UserDAOImpl() {
|
||||
super(User.class);
|
||||
}
|
||||
|
||||
public User findByUsername(String username) {
|
||||
return (User) getEntityManager().createNamedQuery("User.findByUsername")
|
||||
.setParameter("username", username).getSingleResult();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user