Package de.peacei.gae.foodsupplier.data

Examples of de.peacei.gae.foodsupplier.data.User


  }
 
  private JSONObject commentToJSON(Comment comment) throws JSONException{
    final JSONObject result = new JSONObject();
   
    User user = comment.getUser();
    result.put(COMMENT_NAME, user.getName());
    String mailAddy = user.getEmail();
    try {
      mailAddy = mailAddy.substring(0, 3) + "..." + mailAddy.substring(mailAddy.indexOf('@'));
    } catch (Exception ex) {
      mailAddy = "---";
    }
View Full Code Here


     
      if(menuDAO.isMenuKey(key)) {
        final Comment comment = new Comment();
       
        final UserDAO userDAO = new UserDAO();
        User user = userDAO.getUserViaMail(email);
        if(user == null) {
          user = new User();
          user.setEmail(email);
          user.setName(name);
        }
        comment.setUser(user);
       
        DateTime dateTime = new DateTime(DateTimeZone.forTimeZone(CalendarUtil.getCalendar().getTimeZone()));
        comment.setTimestamp(dateTime.getMillis());
View Full Code Here

     
      final Key key = KeyFactory.stringToKey(foodKey);
     
      if(foodDAO.isFoodKey(key)) {
       
        User user = userDAO.getUserViaMail(email);
        if(user == null) {
          user = new User();
          user.setEmail(email);
          user.setName(name);
        }   
       
        final Rating rating = new Rating();
        rating.setUser(user);
        rating.setFoodKey(key);
View Full Code Here

*
*/
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");
View Full Code Here

TOP

Related Classes of de.peacei.gae.foodsupplier.data.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.