Examples of Residence


Examples of models.Residence

    UserResidenceJSON admin = (UserResidenceJSON) get("admin");
    return admin;
  }
 
  public Residence getResidence() {
    Residence residence = new Residence();
    residence.id = (Long) get("id");
    residence.name = (String) get("name");
   
    return residence;
  }
View Full Code Here

Examples of models.Residence

import exceptions.ValidationException;

public class Residences extends BaseController {
 
  public static void get() {
    Residence residence = Residence.findAll().get(0);
    renderJSON(gson().toJson(residence));
  }
View Full Code Here

Examples of models.Residence

    Residence residence = Residence.findAll().get(0);
    renderJSON(gson().toJson(residence));
  }
 
  public static void edit(Long id,  JsonObject body) {
    Residence residence = new Gson().fromJson(body, Residence.class);
    if(residence==null) {
      response.status = StatusCode.NOT_FOUND;
      return;
    }
    residence.update();
    response.status = StatusCode.OK;
    String url = Router.reverse("api.Residences.get").url;// GET /api/residence/
    response.setHeader("location", url);
  }
View Full Code Here

Examples of models.Residence

  @Before
  public static void checkResidence() {
    Logger.debug("---------------- checkResidence() ------------------------");
    String name = params.get("residenceName");
    if(name == null || ("").equals(name)) notFound();
    Residence residence = Residence.findByName(name);
    if(residence == null) notFound();
    Logger.debug("---------------- Namespace: %s ------------------------", name);
    flash.put("residenceName", name);
    NamespaceManager.set(String.valueOf(residence.id));
    renderArgs.put("residence", residence);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.