Produced by Araxis Merge on 6/11/2019 10:54:09 AM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\ccht\persistent\hibernate | ReportDAOImpl.java | Wed May 29 15:26:38 2019 UTC |
| 2 | HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\ccht\persistent\hibernate | ReportDAOImpl.java | Mon Jun 10 19:19:21 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 662 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | /********* ********** ********** ********** ********** ********** ********* | |
| 2 | * Copyrig ht � 2010 VHA. All r ights rese rved | |
| 3 | ********* ********** ********** ********** ********** ********** *********/ | |
| 4 | package go v.va.med.c cht.persis tent.hiber nate; | |
| 5 | ||
| 6 | import jav a.util.Dat e; | |
| 7 | import jav a.util.Lin kedHashMap ; | |
| 8 | import jav a.util.Lis t; | |
| 9 | import jav a.util.Map ; | |
| 10 | ||
| 11 | import jav ax.transac tion.Trans actional; | |
| 12 | ||
| 13 | import org .apache.co mmons.lang 3.Validate ; | |
| 14 | import org .apache.lo g4j.Logger ; | |
| 15 | import org .hibernate .Session; | |
| 16 | import org .hibernate .SessionFa ctory; | |
| 17 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
| 18 | import org .springfra mework.ste reotype.Re pository; | |
| 19 | ||
| 20 | import gov .va.med.cc ht.model.r eport.Comp letedRepor t; | |
| 21 | import gov .va.med.cc ht.model.r eport.Comp letedRepor tFieldType ; | |
| 22 | import gov .va.med.cc ht.model.r eport.Sche duledRepor t; | |
| 23 | import gov .va.med.cc ht.model.r eport.Simp leComplete dReport; | |
| 24 | import gov .va.med.cc ht.model.t erminology .StandardR eport; | |
| 25 | import gov .va.med.cc ht.persist ent.Report DAO; | |
| 26 | import gov .va.med.cc ht.service .report.Co mpletedRep ortsSearch QueryInfo; | |
| 27 | import gov .va.med.cc ht.service .report.Re portFilter SearchQuer yInfo; | |
| 28 | import gov .va.med.fw .model.Ent ityKey; | |
| 29 | import gov .va.med.fw .persisten t.DAOExcep tion; | |
| 30 | import gov .va.med.fw .persisten t.MaxRecor dsExceeded Exception; | |
| 31 | import gov .va.med.fw .report.Re portExport edType; | |
| 32 | ||
| 33 | ||
| 34 | /** | |
| 35 | * | |
| 36 | * | |
| 37 | * IHTA IH TA_common Aug 8, 201 0 | |
| 38 | * | |
| 39 | * @author DNS | |
| 40 | */ | |
| 41 | @Repositor y | |
| 42 | @Transacti onal | |
| 43 | public cla ss ReportD AOImpl imp lements Re portDAO { | |
| 44 | ||
| 45 | pr ivate stat ic final l ong serial VersionUID = 5155804 8765795931 42L; | |
| 46 | ||
| 47 | pr ivate Logg er logger = Logger.g etLogger(g etClass()) ; | |
| 48 | ||
| 49 | // These sta tic final values mat ch the nam es in hibe rnate mapp ing files. | |
| 50 | pr ivate stat ic final S tring QUER Y_GET_DIST INCT_STAND ARD_REPORT S_FROM_COM PLETED_REP ORTS = "st andardRepo rtQuery_Ge tDistinctS tandardRep ortsFromCo mpletedRep orts"; | |
| 51 | pr ivate stat ic final S tring QUER Y_GET_DIST INCT_EXPOR T_TYPES_FR OM_COMPLET ED_REPORTS = "report ExportType Query_GetD istinctExp ortTypesFr omComplete dReports"; | |
| 52 | pr ivate stat ic final S tring USER _PARAM_NAM E = "user" ; | |
| 53 | pr ivate stat ic final S tring REPO RT_IDS = " reportIds" ; | |
| 54 | pr ivate stat ic final S tring REPO RT_EXPIRIN G_DAYS = " expiringDa ys"; | |
| 55 | pr ivate stat ic final S tring REPO RT_WARNIG_ DAYS = "wa rningDays" ; | |
| 56 | ||
| 57 | @A utowired | |
| 58 | pr ivate Sess ionFactory sessionFa ctory; | |
| 59 | ||
| 60 | pr otected Se ssion getS ession() { | |
| 61 | retu rn this.se ssionFacto ry.getCurr entSession (); | |
| 62 | } | |
| 63 | ||
| 64 | /* * | |
| 65 | * A default construct or | |
| 66 | * / | |
| 67 | pu blic Repor tDAOImpl() { | |
| 68 | supe r(); | |
| 69 | } | |
| 70 | ||
| 71 | pu blic Sched uledReport getSchedu ledReport( EntityKey< ScheduledR eport> ide ntifier) t hrows DAOE xception { | |
| 72 | Vali date.notNu ll(identif ier, "Sche duledRepor t identifi er can not be null." ); | |
| 73 | Vali date.notNu ll(identif ier.getKey Value(), " ScheduledR eport iden tifier key can not b e null."); | |
| 74 | ||
| 75 | logg er.error(" $$$$$$ fix me"); | |
| 76 | retu rn null; | |
| 77 | // try { | |
| 78 | // Schedu ledReport scheduledR eport = su per.getByK ey(identif ier); | |
| 79 | // return scheduled Report; | |
| 80 | // } ca tch (Excep tion e) { | |
| 81 | // throw new DAOExc eption("Fa iled to ge t Schedule dReport by id " | |
| 82 | // + identifi er.getKeyV alueAsStri ng(), e); | |
| 83 | // } | |
| 84 | } | |
| 85 | ||
| 86 | pu blic Sched uledReport saveSched uledReport (Scheduled Report sch eduledRepo rt) throws DAOExcept ion { | |
| 87 | ||
| 88 | logg er.error(" $$$$$$ fix me"); | |
| 89 | retu rn null; | |
| 90 | // try { | |
| 91 | // // CCR 407. Avo id modifyi ng CISS fr amework so changes a re made | |
| 92 | // // in ReportDAOI mpl to set an ID in the new en tity | |
| 93 | // | |
| 94 | // Valida te.notNull (scheduled Report, "S cheduledRe port ident ifier can not be nul l."); | |
| 95 | // Schedu ledReport persisted = (Schedul edReport)s uper.getJp aTemplate( ).merge( s cheduledRe port ); | |
| 96 | // super. getJpaTemp late().flu sh(); | |
| 97 | // return persisted ; | |
| 98 | // } | |
| 99 | // catc h( Excepti on e ) { | |
| 100 | // throw new DAOExc eption("Fa iled to sc hedule a r eport", e) ; | |
| 101 | // } | |
| 102 | } | |
| 103 | ||
| 104 | pu blic void deleteSche duledRepor t(EntityKe y<Schedule dReport> i dentifier) throws DA OException { | |
| 105 | ||
| 106 | logg er.error(" $$$$$$ fix me"); | |
| 107 | ||
| 108 | // Vali date.notNu ll(identif ier, "Sche duledRepor t identifi er can not be null." ); | |
| 109 | // Vali date.notNu ll(identif ier.getKey Value(), " ScheduledR eport iden tifier key can not b e null."); | |
| 110 | // supe r.removeOb ject(ident ifier); | |
| 111 | } | |
| 112 | ||
| 113 | pu blic Compl etedReport getComple tedReport( EntityKey< CompletedR eport> ide ntifier) | |
| 114 | throws DAOExcept ion { | |
| 115 | ||
| 116 | logg er.error(" $$$$$$ fix me"); | |
| 117 | retu rn null; | |
| 118 | ||
| 119 | // Vali date.notNu ll(identif ier, "Comp letedRepor t identifi er can not be null." ); | |
| 120 | // Vali date.notNu ll(identif ier.getKey Value(), | |
| 121 | // "Complet edReport i dentifier key can no t be null. "); | |
| 122 | // | |
| 123 | // try { | |
| 124 | // Comple tedReport completedR eport = su per.getByK ey(identif ier); | |
| 125 | // return completed Report; | |
| 126 | // } ca tch (Excep tion e) { | |
| 127 | // throw new DAOExc eption("Fa iled to ge t Complete dReport by id " | |
| 128 | // + identifi er.getKeyV alueAsStri ng(), e); | |
| 129 | // } | |
| 130 | } | |
| 131 | ||
| 132 | /* | |
| 133 | * @see | |
| 134 | * gov.va.me d.esr.comm on.persist ent.report .ReportDAO #getSimple CompletedR eport | |
| 135 | * (gov.va.m ed.fw.mode l.EntityKe y) | |
| 136 | * / | |
| 137 | pu blic Simpl eCompleted Report get SimpleComp letedRepor t( | |
| 138 | Entity Key<Simple CompletedR eport> ide ntifier) t hrows DAOE xception { | |
| 139 | ||
| 140 | logg er.error(" $$$$$$ fix me"); | |
| 141 | retu rn null; | |
| 142 | ||
| 143 | // Vali date.notNu ll(identif ier, "Simp leComplete dReport id entifier c an not be null."); | |
| 144 | // Vali date.notNu ll(identif ier.getKey Value(), | |
| 145 | // "SimpleC ompletedRe port ident ifier key can not be null."); | |
| 146 | // | |
| 147 | // try { | |
| 148 | // Simple CompletedR eport simp leComplete dReport = super.getB yKey(ident ifier); | |
| 149 | // return simpleCom pletedRepo rt; | |
| 150 | // } ca tch (Excep tion e) { | |
| 151 | // throw new DAOExc eption("Fa iled to ge t SimpleCo mpletedRep ort by id " | |
| 152 | // + identifi er.getKeyV alueAsStri ng(), e); | |
| 153 | // } | |
| 154 | } | |
| 155 | ||
| 156 | pu blic void saveComple tedReport( CompletedR eport comp letedRepor t) throws DAOExcepti on { | |
| 157 | ||
| 158 | logg er.error(" $$$$$$ fix me"); | |
| 159 | // supe r.persist( completedR eport); | |
| 160 | } | |
| 161 | ||
| 162 | pu blic void saveSimple CompletedR eport(Simp leComplete dReport co mpletedRep ort) | |
| 163 | throws DAOExcept ion { | |
| 164 | logg er.error(" $$$$$$ fix me"); | |
| 165 | // supe r.persist( completedR eport); | |
| 166 | } | |
| 167 | ||
| 168 | /* | |
| 169 | * @see | |
| 170 | * gov.va.me d.esr.comm on.persist ent.report .ReportDAO #searchCom pletedRepo rts | |
| 171 | * (gov.va.m ed.esr.ser vice.Compl etedReport sSearchQue ryInfo) | |
| 172 | * / | |
| 173 | @S uppressWar nings("unc hecked") | |
| 174 | pu blic List< SimpleComp letedRepor t> searchC ompletedRe ports( | |
| 175 | Comple tedReports SearchQuer yInfo sear chCriteria Info) thro ws DAOExce ption, | |
| 176 | MaxRec ordsExceed edExceptio n { | |
| 177 | ||
| 178 | logg er.error(" $$$$$$ fix me"); | |
| 179 | retu rn null; | |
| 180 | ||
| 181 | // User Principal user = sea rchCriteri aInfo.getU ser(); | |
| 182 | // List <String> r eportIds = searchCri teriaInfo. getReportI ds(); | |
| 183 | // Map< String, Ob ject> parm s = new Ha shMap<Stri ng, Object >(); | |
| 184 | // if ( user != nu ll && Stri ngUtils.is NotEmpty(u ser.getNam e())) { | |
| 185 | // parms. put(USER_P ARAM_NAME, user.getN ame()); | |
| 186 | // return getJpaTem plate().fi ndByNamedQ ueryAndNam edParams(" getComplet edReportsB yUser", | |
| 187 | // parms); | |
| 188 | // } el se if (rep ortIds != null && re portIds.si ze() > 0) { | |
| 189 | // List<L ong> ids = new Array List<Long> (); | |
| 190 | // for (S tring repo rtId : rep ortIds) { | |
| 191 | // ids.add( new Long(r eportId)); | |
| 192 | // } | |
| 193 | // parms. put(REPORT _IDS, ids) ; | |
| 194 | // return getJpaTem plate().fi ndByNamedQ ueryAndNam edParams(" getComplet edReportsB yIds", | |
| 195 | // parms); | |
| 196 | // } el se { | |
| 197 | // return getJpaTem plate().fi ndByNamedQ uery("getC ompletedRe ports"); | |
| 198 | // } | |
| 199 | } | |
| 200 | ||
| 201 | /* | |
| 202 | * @see | |
| 203 | * gov.va.me d.esr.comm on.persist ent.report .ReportDAO #searchSch eduledRepo rts | |
| 204 | * (gov.va.m ed.esr.ser vice.Sched uledReport sSearchQue ryInfo) | |
| 205 | * / | |
| 206 | @S uppressWar nings("unc hecked") | |
| 207 | pu blic List< ScheduledR eport> sea rchSchedul edReports( ReportFilt erSearchQu eryInfo se archCriter iaInfo) | |
| 208 | throws DAOExcept ion, MaxRe cordsExcee dedExcepti on { | |
| 209 | ||
| 210 | logg er.error(" $$$$$$ fix me"); | |
| 211 | retu rn null; | |
| 212 | // User Principal user = sea rchCriteri aInfo.getU ser(); | |
| 213 | // Map< String, Ob ject> parm s = new Ha shMap<Stri ng, Object >(); | |
| 214 | // if ( user != nu ll) { | |
| 215 | // parms. put(USER_P ARAM_NAME, user.getN ame()); | |
| 216 | // return getJpaTem plate().fi ndByNamedQ ueryAndNam edParams(" getSchedul edReportsB yUser", | |
| 217 | // parms); | |
| 218 | // } el se { | |
| 219 | // return getJpaTem plate().fi ndByNamedQ uery("getS cheduledRe ports"); | |
| 220 | // } | |
| 221 | } | |
| 222 | ||
| 223 | /* | |
| 224 | * @see | |
| 225 | * gov.va.me d.esr.comm on.persist ent.report .ReportDAO #deleteCom pletedRepo rt | |
| 226 | * (gov.va.m ed.fw.mode l.EntityKe y) | |
| 227 | * / | |
| 228 | pu blic void deleteComp letedRepor t(EntityKe y<Complete dReport> i dentifier) throws DA OException { | |
| 229 | ||
| 230 | logg er.error(" $$$$$$ fix me"); | |
| 231 | ||
| 232 | // Vali date.notNu ll(identif ier, "Comp letedRepor t identifi er can not be null." ); | |
| 233 | // Vali date.notNu ll(identif ier.getKey Value(), | |
| 234 | // "Complet edReport i dentifier key can no t be null. "); | |
| 235 | // supe r.removeOb ject(ident ifier); | |
| 236 | } | |
| 237 | ||
| 238 | /* | |
| 239 | * @see | |
| 240 | * gov.va.me d.esr.comm on.persist ent.report .ReportDAO #getDistin ctStandard Reports | |
| 241 | * () | |
| 242 | * / | |
| 243 | @S uppressWar nings("unc hecked") | |
| 244 | pu blic List< StandardRe port> getD istinctSta ndardRepor ts() throw s DAOExcep tion { | |
| 245 | ||
| 246 | logg er.error(" $$$$$$ fix me"); | |
| 247 | retu rn null; | |
| 248 | ||
| 249 | // try { | |
| 250 | // return getJpaTem plate().fi ndByNamedQ uery( | |
| 251 | // QUERY_GET_ DISTINCT_S TANDARD_RE PORTS_FROM _COMPLETED _REPORTS); | |
| 252 | // } ca tch (Excep tion e) { | |
| 253 | // throw new DAOExc eption( | |
| 254 | // "Failed to get disti nct standa rd reports from comp lated repo rts", e); | |
| 255 | // } | |
| 256 | } | |
| 257 | ||
| 258 | /* | |
| 259 | * @seegov.v a.med.esr. common.per sistent.re port.Repor tDAO# | |
| 260 | * getDistin ctReportEx portTypes( ) | |
| 261 | * / | |
| 262 | @S uppressWar nings("unc hecked") | |
| 263 | pu blic List< ReportExpo rtedType> getDistinc tReportExp ortTypes() throws DA OException { | |
| 264 | ||
| 265 | logg er.error(" $$$$$$ fix me"); | |
| 266 | retu rn null; | |
| 267 | ||
| 268 | // try { | |
| 269 | // return getJpaTem plate().fi ndByNamedQ uery( | |
| 270 | // QUERY_GET_ DISTINCT_E XPORT_TYPE S_FROM_COM PLETED_REP ORTS); | |
| 271 | // } ca tch (Excep tion e) { | |
| 272 | // throw new DAOExc eption( | |
| 273 | // "Failed to get disti nct report export ty pes from c omplated r eports", e ); | |
| 274 | // } | |
| 275 | } | |
| 276 | ||
| 277 | /* * | |
| 278 | * Purge ale rts and co mpleted re ports whic h are olde r than ?(3 65) days | |
| 279 | * / | |
| 280 | pu blic Integ er purgeCo mpletedRep orts() thr ows DAOExc eption { | |
| 281 | ||
| 282 | try { | |
| 283 | String sql = "de lete from ht.complet ed_reports where rep ort_expira tion_date < getdate( )"; | |
| 284 | return getSessio n().create NativeQuer y(sql).exe cuteUpdate (); | |
| 285 | } ca tch (Excep tion e) { | |
| 286 | throw new DAOExc eption("pu rgeComplet edReports failed", e ); | |
| 287 | } | |
| 288 | } | |
| 289 | ||
| 290 | /* * | |
| 291 | * Get expir ing report id, user m ap to crea te alerts | |
| 292 | * / | |
| 293 | @S uppressWar nings("unc hecked") | |
| 294 | pu blic Map<S tring, Str ing> getEx piringRepo rtIdUserMa p(Integer expiringDa ys, Intege r warningD ays) | |
| 295 | throws DAOExcept ion { | |
| 296 | ||
| 297 | ||
| 298 | logg er.error(" $$$$$$ fix me"); | |
| 299 | retu rn null; | |
| 300 | ||
| 301 | ||
| 302 | // try { | |
| 303 | // Map<St ring, Stri ng> map = new HashMa p<String, String>(); | |
| 304 | // // exe cute and g et the res ults | |
| 305 | // Map<St ring, Obje ct> paramM ap = new H ashMap<Str ing, Objec t>(); | |
| 306 | // paramM ap.put(REP ORT_EXPIRI NG_DAYS, e xpiringDay s); | |
| 307 | // paramM ap.put(REP ORT_WARNIG _DAYS, war ningDays); | |
| 308 | // List<O bject[]> r esults = g etJpaTempl ate().find ByNamedQue ryAndNamed Params( | |
| 309 | // "expiringR eports", p aramMap); | |
| 310 | // for (O bject[] re sult : res ults) { | |
| 311 | // map.put( (String) r esult[0], (String) r esult[1]); | |
| 312 | // } | |
| 313 | // return map; | |
| 314 | // } ca tch (Excep tion e) { | |
| 315 | // throw new DAOExc eption("ge tExpiringR eportIds f ailed " + e.getMessa ge(), e); | |
| 316 | // } | |
| 317 | } | |
| 318 | ||
| 319 | @S uppressWar nings("unc hecked") | |
| 320 | pu blic Linke dHashMap<S tring, Str ing> getUn iqueFilter Values(Com pletedRepo rtFieldTyp e fieldTyp e) { | |
| 321 | ||
| 322 | logg er.error(" $$$$$$ fix me"); | |
| 323 | retu rn null; | |
| 324 | ||
| 325 | ||
| 326 | // Link edHashMap< String, St ring> uniq ueValMap = new Linke dHashMap<S tring, Str ing>(); | |
| 327 | // List <Object[]> results = getJpaTem plate().fi ndByNamedQ uery(field Type.getNa medQuery() ); | |
| 328 | // for (Object[] item : res ults) | |
| 329 | // unique ValMap.put ((String) item[0], ( String) it em[1]); | |
| 330 | // retu rn uniqueV alMap; | |
| 331 | } | |
| 332 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.