Produced by Araxis Merge on 4/27/2018 2:59:08 PM Central 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 | v2.0_Sprint_15_Build_5.zip\v2.0_Sprint_15_Build_5\Unredacted\ARS_Backend\ars_app\src\main\java\gov\va\med\ars\configuration\hibernate | ArsPersistenceConfig.java | Tue Apr 24 14:50:45 2018 UTC |
| 2 | v2.0_Sprint_15_Build_5..zip\v2.0_Sprint_15_Build_5\Unredacted\ARS_Backend\ars_app\src\main\java\gov\va\med\ars\configuration\hibernate | ArsPersistenceConfig.java | Thu Apr 26 14:00:33 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 160 |
| 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 | * | |
| 3 | */ | |
| 4 | package go v.va.med.a rs.configu ration.hib ernate; | |
| 5 | ||
| 6 | import jav a.util.Has hMap; | |
| 7 | ||
| 8 | import jav ax.persist ence.Entit yManagerFa ctory; | |
| 9 | import jav ax.sql.Dat aSource; | |
| 10 | ||
| 11 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
| 12 | import org .springfra mework.con text.annot ation.Bean ; | |
| 13 | import org .springfra mework.con text.annot ation.Conf iguration; | |
| 14 | import org .springfra mework.con text.annot ation.Prim ary; | |
| 15 | import org .springfra mework.cor e.env.Envi ronment; | |
| 16 | import org .springfra mework.dat a.jpa.repo sitory.con fig.Enable JpaReposit ories; | |
| 17 | import org .springfra mework.jdb c.datasour ce.DriverM anagerData Source; | |
| 18 | import org .springfra mework.orm .hibernate 5.Hibernat eException Translator ; | |
| 19 | import org .springfra mework.orm .jpa.JpaTr ansactionM anager; | |
| 20 | import org .springfra mework.orm .jpa.Local ContainerE ntityManag erFactoryB ean; | |
| 21 | import org .springfra mework.orm .jpa.vendo r.Hibernat eJpaVendor Adapter; | |
| 22 | import org .springfra mework.tra nsaction.P latformTra nsactionMa nager; | |
| 23 | import org .springfra mework.tra nsaction.a nnotation. EnableTran sactionMan agement; | |
| 24 | ||
| 25 | /** | |
| 26 | * @author PI I
|
|
| 27 | * | |
| 28 | */ | |
| 29 | ||
| 30 | @Configura tion | |
| 31 | @EnableTra nsactionMa nagement | |
| 32 | @EnableJpa Repositori es(basePac kages = "g ov.va.med. ars.dao.ar s", entity ManagerFac toryRef = "arsEntity Manager", transactio nManagerRe f = "arsTr ansactionM anager") | |
| 33 | public cla ss ArsPers istenceCon fig { | |
| 34 | ||
| 35 | @A utowired | |
| 36 | pr ivate Envi ronment en v; | |
| 37 | ||
| 38 | @P rimary | |
| 39 | @B ean(name = "arsEntit yManager") | |
| 40 | pu blic Local ContainerE ntityManag erFactoryB ean arsEnt ityManager () { | |
| 41 | fina l LocalCon tainerEnti tyManagerF actoryBean em = new LocalConta inerEntity ManagerFac toryBean() ; | |
| 42 | em.s etDataSour ce(arsData Source()); | |
| 43 | em.s etPackages ToScan(new String[] { "gov.va. med.domain " }); | |
| 44 | ||
| 45 | fina l Hibernat eJpaVendor Adapter ve ndorAdapte r = new Hi bernateJpa VendorAdap ter(); | |
| 46 | em.s etJpaVendo rAdapter(v endorAdapt er); | |
| 47 | fina l HashMap< String, Ob ject> prop erties = n ew HashMap <String, O bject>(); | |
| 48 | prop erties.put ("hibernat e.hbm2ddl. auto", env .getProper ty("hibern ate.hbm2dd l.auto")); | |
| 49 | prop erties.put ("hibernat e.dialect" , env.getP roperty("h ibernate.d ialect")); | |
| 50 | em.s etJpaPrope rtyMap(pro perties); | |
| 51 | ||
| 52 | retu rn em; | |
| 53 | } | |
| 54 | ||
| 55 | @P rimary | |
| 56 | @B ean(name = "arsDataS ource") | |
| 57 | pu blic DataS ource arsD ataSource( ) { | |
| 58 | fina l DriverMa nagerDataS ource data Source = n ew DriverM anagerData Source(); | |
| 59 | data Source.set DriverClas sName(env. getPropert y("jdbc.ar s.driverCl assName")) ; | |
| 60 | data Source.set Url(env.ge tProperty( "jdbc.ars. url")); | |
| 61 | data Source.set Username(e nv.getProp erty("jdbc .ars.usern ame")); | |
| 62 | data Source.set Password(e nv.getProp erty("jdbc .ars.passw ord")); | |
| 63 | ||
| 64 | retu rn dataSou rce; | |
| 65 | } | |
| 66 | ||
| 67 | @P rimary | |
| 68 | @B ean | |
| 69 | pu blic Hiber nateExcept ionTransla tor hibern ateExcepti onTranslat or() { | |
| 70 | retu rn new Hib ernateExce ptionTrans lator(); | |
| 71 | } | |
| 72 | ||
| 73 | @P rimary | |
| 74 | @B ean(name = "arsTrans actionMana ger") | |
| 75 | pu blic Platf ormTransac tionManage r arsTrans actionMana ger() { | |
| 76 | Enti tyManagerF actory fac tory = ars EntityMana ger().getO bject(); | |
| 77 | ||
| 78 | retu rn new Jpa Transactio nManager(f actory); | |
| 79 | } | |
| 80 | ||
| 81 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.