Package com.centraview.common

Examples of com.centraview.common.MasterDictionary


   * This method returns the MasterDictionary Object having relationship between
   * tables and their Fields.
   */
  public  MasterDictionary getMasterDictionary()
  {
    MasterDictionary mdObj = null;
    CVDal dl = new CVDal(dataSource);
    try
    {
      mdObj = new MasterDictionary();

      dl.setSql("common.getmasterdictionary");
      Collection  col  = (Collection) dl.executeQuery();
      dl.clearParameters();

      Iterator it = col.iterator();
      while (it.hasNext())
      {
        HashMap hm  = (HashMap)it.next();

        String table1  = (String) hm.get("table1");
        String table2  = (String) hm.get("table2");
        String field1  = (String) hm.get("field1");
        String field2  = (String) hm.get("field1");
        String clause  = (String) hm.get("clause");
        String otherTable= (String) hm.get("othertablename");

        // Check whether allready Present or Not
        // if Present then get and add  to it.
        // else put New Object.
        if (mdObj.containsKey(table2))
        {
          HashMap innHMap = (HashMap)mdObj.get(table2);
          Vector vec = (Vector)innHMap.get(table1);
          if (vec == null)
          {
            vec = new Vector();
          } //end of if statement (vec == null)
          vec.add(new TableRelate(table1,field1,field2,clause,otherTable));
          innHMap.put(table1,vec);
          mdObj.put(table2,innHMap);
        } //end of if statement (mdObj.containsKey(table2))
        else
        {
          HashMap  add = new HashMap();
          Vector vec = new Vector();
          vec.add(new TableRelate(table1,field1,field2,clause,otherTable));
          add.put(table1,vec);
          mdObj.put(table2,add);
        } //end of else statement (mdObj.containsKey(table2))
      }// end of while loop (it.hasNext())
    } //end of try block
    catch(Exception e)
    {
View Full Code Here

TOP

Related Classes of com.centraview.common.MasterDictionary

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.