This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public User findByEmail(String email) { | |
Query query = this.em.createQuery("SELECT user FROM User u where u.email= :theemail"); | |
query.setParameter("theemail", email); | |
return (User) query.getSingleResult(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static ApplicationProperties loadProperties() { | |
Properties prop = new Properties(); | |
InputStream input = null; | |
try { | |
ClassLoader classloader = Thread.currentThread().getContextClassLoader(); | |
input = classloader.getResourceAsStream("config.properties"); | |
// load a properties file | |
prop.load(input); |
OlderNewer