Produced by Araxis Merge on 3/8/2018 10:11:37 AM Eastern Standard 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 | PRE_PPS-N_v3.0.1.zip\PS_PPS_domain\src\main\java\gov\va\med\pharmacy\peps\domain\common\capability\impl | PrimaryIngredientDomainCapabilityImpl.java | Fri Jan 12 15:42:34 2018 UTC |
2 | PRE_PPS-N_v3.0.1.zip\PS_PPS_domain\src\main\java\gov\va\med\pharmacy\peps\domain\common\capability\impl | PrimaryIngredientDomainCapabilityImpl.java | Tue Mar 6 23:51:04 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 394 |
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 | package go v.va.med.p harmacy.pe ps.domain. common.cap ability.im pl; | |
2 | ||
3 | ||
4 | import gov .va.med.ph armacy.pep s.common.e xception.D uplicateIt emExceptio n; | |
5 | import gov .va.med.ph armacy.pep s.common.e xception.V alidationE xception; | |
6 | import gov .va.med.ph armacy.pep s.common.u tility.PPS Constants; | |
7 | import gov .va.med.ph armacy.pep s.common.v o.ManagedI temVo; | |
8 | import gov .va.med.ph armacy.pep s.common.v o.PrimaryI ngredientV o; | |
9 | import gov .va.med.ph armacy.pep s.common.v o.UserVo; | |
10 | import gov .va.med.ph armacy.pep s.domain.c ommon.capa bility.Pri maryIngred ientDomain Capability ; | |
11 | import gov .va.med.ph armacy.pep s.domain.c ommon.dao. DataAccess Object; | |
12 | import gov .va.med.ph armacy.pep s.domain.c ommon.dao. EplIngredi entDao; | |
13 | import gov .va.med.ph armacy.pep s.domain.c ommon.mode l.EplIngre dientDo; | |
14 | import gov .va.med.ph armacy.pep s.domain.c ommon.util ity.conver ter.Conver ter; | |
15 | import gov .va.med.ph armacy.pep s.domain.c ommon.util ity.conver ter.Primar yIngredien tConverter ; | |
16 | import gov .va.med.ph armacy.pep s.domain.c ommon.util ity.queryb uilder.Hql Builder; | |
17 | ||
18 | import jav a.util.Col lection; | |
19 | import jav a.util.Lis t; | |
20 | ||
21 | import org .apache.co mmons.lang 3.StringUt ils; | |
22 | import org .hibernate .Criteria; | |
23 | import org .hibernate .criterion .Restricti ons; | |
24 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
25 | ||
26 | ||
27 | ||
28 | /** | |
29 | * @author DNS | |
30 | * Perfor m readonly operation s on Ingre dients. Fo r Create, Update, De lete, Ingr edientDoma inCapabili tyImpl sho uld be use d. | |
31 | * | |
32 | */ | |
33 | public cla ss Primary Ingredient DomainCapa bilityImpl extends ManagedDat aDomainCap abilityImp l<PrimaryI ngredientV o, EplIngr edientDo> | |
34 | implements PrimaryIn gredientDo mainCapabi lity { | |
35 | ||
36 | @Autow ired | |
37 | privat e EplIngre dientDao e plIngredie ntDao; | |
38 | ||
39 | privat e PrimaryI ngredientC onverter p rimaryIngr edientConv erter; | |
40 | ||
41 | /** | |
42 | * @pa ram eplIng redientDao the eplIn gredientDa o to set | |
43 | */ | |
44 | public void setE plIngredie ntDao(EplI ngredientD ao eplIngr edientDao) { | |
45 | th is.eplIngr edientDao = eplIngre dientDao; | |
46 | } | |
47 | ||
48 | ||
49 | /** | |
50 | * @pa ram primar yIngredien tConverter the prima ryIngredie ntConverte r to set | |
51 | */ | |
52 | public void setP rimaryIngr edientConv erter(Prim aryIngredi entConvert er primary Ingredient Converter) { | |
53 | th is.primary Ingredient Converter = primaryI ngredientC onverter; | |
54 | } | |
55 | ||
56 | ||
57 | @Overr ide | |
58 | public Converter <PrimaryIn gredientVo , EplIngre dientDo> g etConverte r() { | |
59 | re turn prima ryIngredie ntConverte r; | |
60 | } | |
61 | ||
62 | @Overr ide | |
63 | public DataAcces sObject ge tDataAcces sObject() { | |
64 | ||
65 | re turn eplIn gredientDa o; | |
66 | } | |
67 | ||
68 | @Overr ide | |
69 | public PrimaryIn gredientVo create(Pr imaryIngre dientVo ma nagedItem, UserVo us er) throws Duplicate ItemExcept ion { | |
70 | ||
71 | re turn null; | |
72 | } | |
73 | ||
74 | @Overr ide | |
75 | public void chec kForActive Dependenci es(Primary Ingredient Vo managed Item, User Vo user) t hrows Vali dationExce ption { | |
76 | ||
77 | } | |
78 | ||
79 | @Overr ide | |
80 | public List<Mana gedItemVo> retrieveD ependencie s(PrimaryI ngredientV o managedI tem) throw s Validati onExceptio n { | |
81 | ||
82 | re turn null; | |
83 | } | |
84 | ||
85 | @Overr ide | |
86 | public PrimaryIn gredientVo createWit houtDuplic ateCheck(P rimaryIngr edientVo m anagedItem , UserVo u ser) { | |
87 | ||
88 | re turn null; | |
89 | } | |
90 | ||
91 | @Overr ide | |
92 | public void dele te(Primary Ingredient Vo item) { | |
93 | ||
94 | } | |
95 | ||
96 | @Overr ide | |
97 | public void dele teItem(Pri maryIngred ientVo ite m) throws Validation Exception { | |
98 | ||
99 | } | |
100 | ||
101 | @Overr ide | |
102 | public void reas sociateAnd Delete(Pri maryIngred ientVo old Item, Prim aryIngredi entVo newI tem, UserV o user) { | |
103 | ||
104 | } | |
105 | ||
106 | @Overr ide | |
107 | public List<Prim aryIngredi entVo> ret rieveDupli cates(Prim aryIngredi entVo mana gedItem) { | |
108 | re turn null; | |
109 | } | |
110 | ||
111 | @Overr ide | |
112 | public PrimaryIn gredientVo update(Pr imaryIngre dientVo ma nagedItem, UserVo us er) throws Duplicate ItemExcept ion { | |
113 | ||
114 | re turn null; | |
115 | } | |
116 | ||
117 | @Overr ide | |
118 | public boolean e xistsByUni quenessFie lds(Primar yIngredien tVo item) { | |
119 | ||
120 | re turn false ; | |
121 | } | |
122 | ||
123 | ||
124 | ||
125 | @Overr ide | |
126 | public PrimaryIn gredientVo retrieveB yName(Stri ng name) { | |
127 | ||
128 | St ring name2 = name; | |
129 | ||
130 | // replace ' with doub le tick. | |
131 | if (name2.co ntains("'" )) { | |
132 | name2 = name2.repl ace("'", " ''"); | |
133 | } | |
134 | ||
135 | St ringBuffer query = n ew StringB uffer(); | |
136 | ||
137 | qu ery.append (HqlBuilde r.create(" SELECT ite m FROM").a ppend(EplI ngredientD o.class).a ppend("ite m")); | |
138 | ||
139 | St ring where Clause = " where nam e LIKE '" + name2 + "'"; | |
140 | ||
141 | qu ery.append (whereClau se); | |
142 | ||
143 | Li st<EplIngr edientDo> returnedDo s = eplIng redientDao .executeHq lQuery(que ry.toStrin g()); | |
144 | ||
145 | if (returned Dos == nul l || retur nedDos.siz e() < 1) { | |
146 | return n ull; | |
147 | } | |
148 | ||
149 | Co llection<P rimaryIngr edientVo> vos = pri maryIngred ientConver ter.conver t(returned Dos); | |
150 | ||
151 | fo r (Primary Ingredient Vo vo : vo s) { | |
152 | if (Stri ngUtils.eq uals(vo.ge tValue(), name2)) { | |
153 | retu rn vo; | |
154 | } | |
155 | } | |
156 | ||
157 | re turn null; | |
158 | } | |
159 | ||
160 | /** | |
161 | * Cre ate Hibern ate {@link Criteria} that will find an i tem by its | |
162 | * uni queness fi elds. | |
163 | * | |
164 | * @pa ram item | |
165 | * {@ link Manag edItemVo} for which to create uniqueness | |
166 | * {@ link Crite ria} | |
167 | * @re turn {@lin k Criteria } | |
168 | */ | |
169 | @Overr ide | |
170 | protec ted | |
171 | Criter ia createU niquenessC riteria(Pr imaryIngre dientVo it em) { | |
172 | Cr iteria cri teria = ge tDataAcces sObject(). getCriteri a(); | |
173 | cr iteria.add (Restricti ons.ilike( EplIngredi entDo.NAME , item.get Value())); | |
174 | re turn crite ria; | |
175 | } | |
176 | ||
177 | ||
178 | @Suppr essWarning s("uncheck ed") | |
179 | public List<Prim aryIngredi entVo> ret rieve() { | |
180 | ||
181 | St ringBuffer query = n ew StringB uffer(); | |
182 | ||
183 | qu ery.append (HqlBuilde r.create(" SELECT ite m FROM "). append(Epl Ingredient Do.class). append(PPS Constants. ITEM)); | |
184 | ||
185 | St ring where Clause = " WHERE EPL _ID_PRIMAR Y_INGREDIE NT_FK is null order by name a sc"; | |
186 | ||
187 | qu ery.append (whereClau se); | |
188 | ||
189 | Li st<EplIngr edientDo> activeIngr edients = eplIngredi entDao.exe cuteHqlQue ry(query.t oString()) ; | |
190 | ||
191 | re turn prima ryIngredie ntConverte r.convertM inimal(act iveIngredi ents); | |
192 | ||
193 | } | |
194 | ||
195 | ||
196 | ||
197 | ||
198 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.