//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public synchronized void initializeCache() throws Exception public virtual void initializeCache() { lock (this) { bool hasOpenedSession = BaseDBUtil.hasOpenedSession(); Session session = BaseDBUtil.currentSession(); hashMap.Clear(); //System.out.println("Seeking for: "+code); o_codingSystem = ProjectInfoTable.DOTTED_STYLE; IEnumerator <ProjectWBSTable> iter = session.createQuery("from ProjectWBSTable as o where o.projectId = " + BaseDBUtil.ProjectUrlId).list().GetEnumerator(); while (iter.MoveNext()) { ProjectWBSTable groupCodeTable = (ProjectWBSTable)iter.Current; //System.out.println("Adding: "+groupCodeTable); hashMap[groupCodeTable.GroupCode] = (GroupCode)groupCodeTable.clone(); } /* * Iterator<ProjectInfoTable> iter = session.createQuery("from ProjectInfoTable o where o.code = '"+o_code+"'").list().iterator(); * * ProjectInfoTable prj = null; * * if ( isEnterprise && iter.hasNext() ) { * prj = (ProjectInfoTable)session.load(ProjectInfoTable.class, iter.next().getProjectInfoId()); * } * else if ( iter.hasNext() ) { * prj = iter.next(); * } * * if ( prj != null ) { * o_codingSystem = prj.getCodeStyle(); * * Iterator iter1 = prj.getWbsSet().iterator(); * * //System.out.println("Processing: "+prj); * while ( iter1.hasNext() ) { * ProjectWBSTable groupCodeTable = (ProjectWBSTable)iter1.next(); * //System.out.println("Adding: "+groupCodeTable); * hashMap.put(groupCodeTable.getGroupCode(), (GroupCode)groupCodeTable.clone()); * } * }*/ if (hasOpenedSession == false) { BaseDBUtil.closeSession(); } } }
public virtual void update(ProjectWBSTable gcTable) { //System.out.println("Updating "+gcTable); hashMap[gcTable.GroupCode] = (GroupCode)gcTable.clone(); }