Package nz.co.transparent.client.controller

Examples of nz.co.transparent.client.controller.GenericController


   
    // Store in cache
    parameterMap.put(parameterKey, parameterValue);

    // Save parameter to table
    GenericController genericController = GenericController.getInstance();
   
    try {
      Map parameterMap = genericController.findWhere("parameter", "parameter_key='" + parameterKey + "'");
      parameterMap.put("parameter", parameterValue);
      genericController.updateRecord("parameter", "parameter_id", parameterMap);
      return true;
    } catch (FinderException fe) {
      return false;
    } catch (UpdaterException ue) {
      return false;
View Full Code Here


    }
   
    Map clientMap = null;
    Map contactDetailMap = null;
//    InputStream is = getClass().getResourceAsStream("CardReport.jasper");
    GenericController genericController = GenericController.getInstance();
    SpecificController specificController = SpecificController.getInstance();
   
    try {
      clientMap = genericController.findWhere("client", "client_id=" + clientID);
    } catch (FinderException fe) {
      throw new ControllerException("No client record found");
    }

    contactDetailMap = specificController.findDefaultContactDetails(clientID);
View Full Code Here

      throw new ControllerException(msg);
    }

    Map clientMap = null;
    Map titleMap = null;
    GenericController genericController = GenericController.getInstance();
    SpecificController specificController =
      SpecificController.getInstance();

    try {
      clientMap =
        genericController.findWhere("client", "client_id=" + clientID);
    } catch (FinderException fe) {
      throw new ControllerException("No client record found");
    }

    try {
      titleMap =
        genericController.findWhere("title", "title_id=" + clientMap.get("title_id"));
    } catch (FinderException fe) {
      throw new ControllerException("No title record found for title_id =" + clientMap.get("title_id"));
    }

    Map reportMap = new HashMap();
View Full Code Here

 
  public void go() {
   
    List titleList = null;
    try {
      GenericController titleController = GenericController.getInstance();
      titleList = titleController.findAll("title", "title_code");
    } catch (ControllerException ce) {
      System.out.println(ce.getMessage());
      return;
    }
View Full Code Here

  public void existsRecord() {
   
    Map columnMap = null;
    boolean found = false;
    try {
      GenericController controller = GenericController.getInstance();
      String where = "person_id=? and role_id=?";
      Integer personID = new Integer(3);
      Integer roleID = new Integer(2);
      Object[] params = new Object[2];
      params[0] = personID;
      params[1] = roleID;
      found = controller.existsRecord("person_role", where, params);

      if (found) {
        System.out.println("found");
      } else {
        System.out.println("NOT found");
View Full Code Here

  public void findWhere() {
   
    Map columnMap = null;
    try {
      GenericController controller = GenericController.getInstance();
      columnMap = controller.findWhere("title", "title_code = 'Mrs'");
    } catch (FinderException ce) {
      System.out.println(ce.getMessage());
      return;
    } catch (ControllerException ce) {
      System.out.println(ce.getMessage());
View Full Code Here

    Map columnMap = null;
    String columnName = null;
    Iterator iterator2 = null;

    try {
      GenericController controller = GenericController.getInstance();
      recordList = controller.findAll("title", "title_code");
      Iterator iterator = recordList.iterator();
      int i = 0;
      while (iterator.hasNext()) {
        System.out.println("===" + i++);
        columnMap = (Map) iterator.next();
View Full Code Here

    columnMap.put("date_created", null);
    columnMap.put("date_updated", null);
    columnMap.put("updater_person_id", new Integer(3));
   
    try {
      GenericController controller = GenericController.getInstance();
      controller.insertRecord("title", "title_id", columnMap);
    } catch (ControllerException ce) {
      System.out.println(ce.getMessage());
      return;
    }
View Full Code Here

    columnMap.put("date_created", null);
    columnMap.put("date_updated", null);
    columnMap.put("updater_person_id", new Integer(3));
   
    try {
      GenericController controller = GenericController.getInstance();
      controller.insertRecord("role", "role_code", columnMap);
    } catch (ControllerException ce) {
      System.out.println(ce.getMessage());
      return;
    }
View Full Code Here

    clientMap.put("occupation_id", new Integer(1));
    clientMap.put("insurance_company_id", new Integer(1));
    clientMap.put("updater_person_id", new Integer(1));
   
    try {
      GenericController controller = GenericController.getInstance();
      controller.insertRecord("client", "client_id", clientMap);
     
      Integer clientID = (Integer) clientMap.get("client_id");
      contactDetailMap.put("contact_detail_id", null);
      contactDetailMap.put("client_id", clientID);
      contactDetailMap.put("contact_type_id", new Integer(1));
      contactDetailMap.put("contact_detail", "contact 1");
      controller.insertRecord("contact_detail", "contact_detail_id", contactDetailMap);
     
      contactDetailMap.put("contact_detail_id", null);
      contactDetailMap.put("client_id", clientID);
      contactDetailMap.put("contact_type_id", new Integer(2));
      contactDetailMap.put("contact_detail", "contact 2");
      controller.insertRecord("contact_detail", "contact_detail_id", contactDetailMap);

      // cascade delete
      String[] childTables = {"contact_detail", "payment"};
      //nz.co.transparent.client.controller.insertMultipleRecord("client", "client_id", clientID, childTables);
    } catch (ControllerException ce) {
View Full Code Here

TOP

Related Classes of nz.co.transparent.client.controller.GenericController

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.