/**
*
*/
package de.peacei.gae.foodsupplier.data.dao;
import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import de.peacei.gae.foodsupplier.data.User;
import de.peacei.gae.foodsupplier.util.PMF;
/**
* @author peacei
*
*/
public class UserDAO {
public User getUserViaMail(String mailAddy) {
User user = null;
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
Query query = pm.newQuery(User.class, "email == mailAddy");
query.declareParameters("String mailAddy");
query.setUnique(true);
user = (User) query.execute(mailAddy);
} catch(Exception e) { }
return user;
}
}