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 | EReposPersistenceConfig.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 | EReposPersistenceConfig.java | Thu Apr 26 14:07:03 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 156 |
| 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.bea ns.factory .annotatio n.Value; | |
| 13 | import org .springfra mework.con text.annot ation.Bean ; | |
| 14 | import org .springfra mework.con text.annot ation.Conf iguration; | |
| 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 | @Configura tion | |
| 30 | @EnableTra nsactionMa nagement | |
| 31 | @EnableJpa Repositori es(basePac kages = "g ov.va.med. ars.dao.er epos", ent ityManager FactoryRef = "eRepos EntityMana ger", tran sactionMan agerRef = "eReposTra nsactionMa nager") | |
| 32 | public cla ss EReposP ersistence Config { | |
| 33 | ||
| 34 | @A utowired | |
| 35 | pr ivate Envi ronment en v; | |
| 36 | ||
| 37 | @V alue("$(in it-db:fals e)") | |
| 38 | pr ivate Stri ng initDat abase; | |
| 39 | ||
| 40 | @B ean(name = "eReposEn tityManage r") | |
| 41 | pu blic Local ContainerE ntityManag erFactoryB ean eRepos EntityMana ger() { | |
| 42 | fina l LocalCon tainerEnti tyManagerF actoryBean em = new LocalConta inerEntity ManagerFac toryBean() ; | |
| 43 | em.s etDataSour ce(eReposD ataSource( )); | |
| 44 | em.s etPackages ToScan(new String[] { "gov.va. med.domain .ereposMod el" }); | |
| 45 | ||
| 46 | fina l Hibernat eJpaVendor Adapter ve ndorAdapte r = new Hi bernateJpa VendorAdap ter(); | |
| 47 | em.s etJpaVendo rAdapter(v endorAdapt er); | |
| 48 | fina l HashMap< String, Ob ject> prop erties = n ew HashMap <String, O bject>(); | |
| 49 | prop erties.put ("hibernat e.hbm2ddl. auto", env .getProper ty("hibern ate.hbm2dd l.auto")); | |
| 50 | prop erties.put ("hibernat e.dialect" , env.getP roperty("h ibernate.d ialect")); | |
| 51 | em.s etJpaPrope rtyMap(pro perties); | |
| 52 | ||
| 53 | retu rn em; | |
| 54 | } | |
| 55 | ||
| 56 | @B ean(name = "eReposDa taSource") | |
| 57 | pu blic DataS ource eRep osDataSour ce() { | |
| 58 | fina l DriverMa nagerDataS ource data Source = n ew DriverM anagerData Source(); | |
| 59 | data Source.set DriverClas sName(env. getPropert y("jdbc.er epos.drive rClassName ")); | |
| 60 | data Source.set Url(env.ge tProperty( "jdbc.erep os.url")); | |
| 61 | data Source.set Username(e nv.getProp erty("jdbc .erepos.us ername")); | |
| 62 | data Source.set Password(e nv.getProp erty("jdbc .erepos.pa ssword")); | |
| 63 | ||
| 64 | retu rn dataSou rce; | |
| 65 | } | |
| 66 | ||
| 67 | @B ean | |
| 68 | pu blic Hiber nateExcept ionTransla tor hibern ateExcepti onTranslat or() { | |
| 69 | retu rn new Hib ernateExce ptionTrans lator(); | |
| 70 | } | |
| 71 | ||
| 72 | @B ean(name = "eReposTr ansactionM anager") | |
| 73 | pu blic Platf ormTransac tionManage r eReposTr ansactionM anager() { | |
| 74 | Enti tyManagerF actory fac tory = eRe posEntityM anager().g etObject() ; | |
| 75 | ||
| 76 | retu rn new Jpa Transactio nManager(f actory); | |
| 77 | } | |
| 78 | ||
| 79 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.