简体   繁体   English

使用 findOne 和 findById 的 hibernate 看不到数据库中更新后触发器在记录上所做的更改

[英]Changes made on record by trigger after update in DB aren't visible by hibernate with findOne and findById

I'm using in my project Spring boot 1.5.22, Spring data and Hibernate 5.2.18.我在我的项目中使用 Spring 启动 1.5.22、Spring 数据和 Hibernate 5.2.18。 When I save my Entity object using Dao with:当我使用 Dao 保存我的实体 object 时:

platDao.save(plat);

in database is executing trigger of type BEFORE INSERT which is inserting a number of document in databse field.在数据库中正在执行 BEFORE INSERT 类型的触发器,该触发器正在数据库字段中插入许多文档。 When I make a select from table in database with SQL in my database tool I can see value in this field.当我在数据库工具中使用 SQL 从数据库中的表中创建 select 时,我可以在该字段中看到值。 But when I get this record using hibernate with findOne method I see null in this field:但是当我使用 hibernate 和 findOne 方法获得此记录时,我在该字段中看到 null:

Platnosc plat = platDao.findOne(platId);

I tried also this:我也试过这个:

Platnosc plat = platDao.findById(platId);

But result is the same, field which is set by trigger is null.但结果是一样的,触发器设置的字段是null。

Code of my Service:我的服务代码:

public List<Platnosc> createDocumentForInvoice(Integer fakturaId) {

    AuthUser user = loginMgr.getLoggedUser();

    Platnosc plat = Platnosc.builder()
            // I don't set field platnoscNr here it is null
            .build();

    platDao.save(plat);

    return plat;
}

Code of my controller:我的 controller 的代码:

public Response createDocumentForInvoice(
        @RequestParam(value = "fakturaId", required = true) Integer fakturaId) {

    List<Platnosc> platList = platMgr.createDocumentForInvoice(fakturaId);

    // after this I can see in database value of field platnoscNr which was inserted by trigger

    String platNr = platList.stream()
            .map(p -> {
                Platnosc plat = platDao.findById(p.getPlatnoscId());     
                return String.format("%s nr %s",
                        platMgr.getRodzajTextForPlatnoscRodzaj(plat.getPlatnoscRodzaj()),
                        plat.getPlatnoscNr());
            })
            .collect(Collectors.joining(", "));

    return Response.ok(platList.size() == 0
            ? "No document was created"
            : "Created documents: " + platNr)
            .build();
}

Response is:回应是:

"Created documents: CREDIT CARD nr null, TRANSFER nr null, OTHER PAYMENT nr null" “创建的文档:信用卡编号 null,转账编号 null,其他付款编号为空”

my DEGUG.log:我的 DEGUG.log:

    // ....
2019-10-10 17:29:33 - Participating in existing transaction
2019-10-10 17:29:33 - insert into PLATNOSC (BANK_ID, EMPLOYEE_ID, FAKTURA_ID, FAKTURA_ID1, FIRMA_ID, GRUPA_ID, KASA_ID, MELDUNEK_ID, OSOBA_ID, PLATNOSC_DATA, PLATNOSC_DATA_KARTY, PLATNOSC_DEKRET_ID, PLATNOSC_FK_NR, PLATNOSC_FORPLA, PLATNOSC_KOD_SYSTEMU, PLATNOSC_KWOTA, PLATNOSC_NR, PLATNOSC_NUMER_KARTY, PLATNOSC_OPIS, PLATNOSC_PREFIX, PLATNOSC_RODZAJ, PLATNOSC_RODZAJ_KARTY_ID, PLATNOSC_STATUS, PLATNOSC_STWORZ_ZALICZKE, PLATNOSC_USED, PLATNOSC_Z_PLATNOSC_ID, PLATONLINE_ID, POKOJ_ID, RACHOTW_ID, REZERWACJA_ID, WALUTA_ID, ZALICZKA_ID, ZMIANA_ID, PLATNOSC_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2019-10-10 17:29:33 - select platnosc0_.PLATNOSC_ID as PLATNOSC1_90_, platnosc0_.BANK_ID as BANK_ID2_90_, platnosc0_.EMPLOYEE_ID as EMPLOYEE3_90_, platnosc0_.FAKTURA_ID as FAKTURA_4_90_, platnosc0_.FAKTURA_ID1 as FAKTURA_5_90_, platnosc0_.FIRMA_ID as FIRMA_ID6_90_, platnosc0_.GRUPA_ID as GRUPA_ID7_90_, platnosc0_.KASA_ID as KASA_ID8_90_, platnosc0_.MELDUNEK_ID as MELDUNEK9_90_, platnosc0_.OSOBA_ID as OSOBA_I10_90_, platnosc0_.PLATNOSC_DATA as PLATNOS11_90_, platnosc0_.PLATNOSC_DATA_KARTY as PLATNOS12_90_, platnosc0_.PLATNOSC_DEKRET_ID as PLATNOS13_90_, platnosc0_.PLATNOSC_FK_NR as PLATNOS14_90_, platnosc0_.PLATNOSC_FORPLA as PLATNOS15_90_, platnosc0_.PLATNOSC_KOD_SYSTEMU as PLATNOS16_90_, platnosc0_.PLATNOSC_KWOTA as PLATNOS17_90_, platnosc0_.PLATNOSC_NR as PLATNOS18_90_, platnosc0_.PLATNOSC_NUMER_KARTY as PLATNOS19_90_, platnosc0_.PLATNOSC_OPIS as PLATNOS20_90_, platnosc0_.PLATNOSC_PREFIX as PLATNOS21_90_, platnosc0_.PLATNOSC_RODZAJ as PLATNOS22_90_, platnosc0_.PLATNOSC_RODZAJ_KARTY_ID as PLATNOS23_90_, platnosc0_.PLATNOSC_STATUS as PLATNOS24_90_, platnosc0_.PLATNOSC_STWORZ_ZALICZKE as PLATNOS25_90_, platnosc0_.PLATNOSC_USED as PLATNOS26_90_, platnosc0_.PLATNOSC_Z_PLATNOSC_ID as PLATNOS27_90_, platnosc0_.PLATONLINE_ID as PLATONL28_90_, platnosc0_.POKOJ_ID as POKOJ_I29_90_, platnosc0_.RACHOTW_ID as RACHOTW30_90_, platnosc0_.REZERWACJA_ID as REZERWA31_90_, platnosc0_.WALUTA_ID as WALUTA_32_90_, platnosc0_.ZALICZKA_ID as ZALICZK33_90_, platnosc0_.ZMIANA_ID as ZMIANA_34_90_ from PLATNOSC platnosc0_ where platnosc0_.FAKTURA_ID=?
2019-10-10 17:29:33 - Found thread-bound EntityManager [SessionImpl(PersistenceContext[entityKeys=[EntityKey[ekoncept.entity.Platnosc#59905], EntityKey[ekoncept.entity.Faktura#141935], EntityKey[ekoncept.entity.Platnosc#59903], EntityKey[ekoncept.entity.Platnosc#59904], EntityKey[ekoncept.entity.Stale#101]],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])] for JPA transaction
2019-10-10 17:29:33 - Participating in existing transaction
2019-10-10 17:29:33 - select platnosc0_.PLATNOSC_ID as PLATNOSC1_90_, platnosc0_.BANK_ID as BANK_ID2_90_, platnosc0_.EMPLOYEE_ID as EMPLOYEE3_90_, platnosc0_.FAKTURA_ID as FAKTURA_4_90_, platnosc0_.FAKTURA_ID1 as FAKTURA_5_90_, platnosc0_.FIRMA_ID as FIRMA_ID6_90_, platnosc0_.GRUPA_ID as GRUPA_ID7_90_, platnosc0_.KASA_ID as KASA_ID8_90_, platnosc0_.MELDUNEK_ID as MELDUNEK9_90_, platnosc0_.OSOBA_ID as OSOBA_I10_90_, platnosc0_.PLATNOSC_DATA as PLATNOS11_90_, platnosc0_.PLATNOSC_DATA_KARTY as PLATNOS12_90_, platnosc0_.PLATNOSC_DEKRET_ID as PLATNOS13_90_, platnosc0_.PLATNOSC_FK_NR as PLATNOS14_90_, platnosc0_.PLATNOSC_FORPLA as PLATNOS15_90_, platnosc0_.PLATNOSC_KOD_SYSTEMU as PLATNOS16_90_, platnosc0_.PLATNOSC_KWOTA as PLATNOS17_90_, platnosc0_.PLATNOSC_NR as PLATNOS18_90_, platnosc0_.PLATNOSC_NUMER_KARTY as PLATNOS19_90_, platnosc0_.PLATNOSC_OPIS as PLATNOS20_90_, platnosc0_.PLATNOSC_PREFIX as PLATNOS21_90_, platnosc0_.PLATNOSC_RODZAJ as PLATNOS22_90_, platnosc0_.PLATNOSC_RODZAJ_KARTY_ID as PLATNOS23_90_, platnosc0_.PLATNOSC_STATUS as PLATNOS24_90_, platnosc0_.PLATNOSC_STWORZ_ZALICZKE as PLATNOS25_90_, platnosc0_.PLATNOSC_USED as PLATNOS26_90_, platnosc0_.PLATNOSC_Z_PLATNOSC_ID as PLATNOS27_90_, platnosc0_.PLATONLINE_ID as PLATONL28_90_, platnosc0_.POKOJ_ID as POKOJ_I29_90_, platnosc0_.RACHOTW_ID as RACHOTW30_90_, platnosc0_.REZERWACJA_ID as REZERWA31_90_, platnosc0_.WALUTA_ID as WALUTA_32_90_, platnosc0_.ZALICZKA_ID as ZALICZK33_90_, platnosc0_.ZMIANA_ID as ZMIANA_34_90_ from PLATNOSC platnosc0_ where platnosc0_.FAKTURA_ID=?
2019-10-10 17:29:33 - Found thread-bound EntityManager [SessionImpl(PersistenceContext[entityKeys=[EntityKey[ekoncept.entity.Platnosc#59905], EntityKey[ekoncept.entity.Faktura#141935], EntityKey[ekoncept.entity.Platnosc#59903], EntityKey[ekoncept.entity.Platnosc#59904], EntityKey[ekoncept.entity.Stale#101]],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])] for JPA transaction
2019-10-10 17:29:33 - Participating in existing transaction
2019-10-10 17:29:33 - select platnosc0_.PLATNOSC_ID as PLATNOSC1_90_, platnosc0_.BANK_ID as BANK_ID2_90_, platnosc0_.EMPLOYEE_ID as EMPLOYEE3_90_, platnosc0_.FAKTURA_ID as FAKTURA_4_90_, platnosc0_.FAKTURA_ID1 as FAKTURA_5_90_, platnosc0_.FIRMA_ID as FIRMA_ID6_90_, platnosc0_.GRUPA_ID as GRUPA_ID7_90_, platnosc0_.KASA_ID as KASA_ID8_90_, platnosc0_.MELDUNEK_ID as MELDUNEK9_90_, platnosc0_.OSOBA_ID as OSOBA_I10_90_, platnosc0_.PLATNOSC_DATA as PLATNOS11_90_, platnosc0_.PLATNOSC_DATA_KARTY as PLATNOS12_90_, platnosc0_.PLATNOSC_DEKRET_ID as PLATNOS13_90_, platnosc0_.PLATNOSC_FK_NR as PLATNOS14_90_, platnosc0_.PLATNOSC_FORPLA as PLATNOS15_90_, platnosc0_.PLATNOSC_KOD_SYSTEMU as PLATNOS16_90_, platnosc0_.PLATNOSC_KWOTA as PLATNOS17_90_, platnosc0_.PLATNOSC_NR as PLATNOS18_90_, platnosc0_.PLATNOSC_NUMER_KARTY as PLATNOS19_90_, platnosc0_.PLATNOSC_OPIS as PLATNOS20_90_, platnosc0_.PLATNOSC_PREFIX as PLATNOS21_90_, platnosc0_.PLATNOSC_RODZAJ as PLATNOS22_90_, platnosc0_.PLATNOSC_RODZAJ_KARTY_ID as PLATNOS23_90_, platnosc0_.PLATNOSC_STATUS as PLATNOS24_90_, platnosc0_.PLATNOSC_STWORZ_ZALICZKE as PLATNOS25_90_, platnosc0_.PLATNOSC_USED as PLATNOS26_90_, platnosc0_.PLATNOSC_Z_PLATNOSC_ID as PLATNOS27_90_, platnosc0_.PLATONLINE_ID as PLATONL28_90_, platnosc0_.POKOJ_ID as POKOJ_I29_90_, platnosc0_.RACHOTW_ID as RACHOTW30_90_, platnosc0_.REZERWACJA_ID as REZERWA31_90_, platnosc0_.WALUTA_ID as WALUTA_32_90_, platnosc0_.ZALICZKA_ID as ZALICZK33_90_, platnosc0_.ZMIANA_ID as ZMIANA_34_90_ from PLATNOSC platnosc0_ where platnosc0_.FAKTURA_ID1=?
2019-10-10 17:29:33 - Initiating transaction commit
2019-10-10 17:29:33 - Committing JPA transaction on EntityManager [SessionImpl(PersistenceContext[entityKeys=[EntityKey[ekoncept.entity.Platnosc#59905], EntityKey[ekoncept.entity.Platnosc#59858], EntityKey[ekoncept.entity.Faktura#141935], EntityKey[ekoncept.entity.Platnosc#59903], EntityKey[ekoncept.entity.Platnosc#59904], EntityKey[ekoncept.entity.Stale#101]],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])]
2019-10-10 17:29:33 - Not closing pre-bound JPA EntityManager after transaction
    // here is findById() method called
2019-10-10 17:29:46 - Found thread-bound EntityManager [SessionImpl(PersistenceContext[entityKeys=[EntityKey[ekoncept.entity.Platnosc#59905], EntityKey[ekoncept.entity.Platnosc#59858], EntityKey[ekoncept.entity.Faktura#141935], EntityKey[ekoncept.entity.Platnosc#59903], EntityKey[ekoncept.entity.Platnosc#59904], EntityKey[ekoncept.entity.Stale#101]],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])] for JPA transaction
2019-10-10 17:29:46 - Creating new transaction with name [org.springframework.data.jpa.repository.support.SimpleJpaRepository.findById]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
2019-10-10 17:29:46 - Exposing JPA transaction as JDBC transaction [org.springframework.orm.jpa.vendor.HibernateJpaDialect$HibernateConnectionHandle@6f808572]
2019-10-10 17:29:46 - select platnosc0_.PLATNOSC_ID as PLATNOSC1_90_, platnosc0_.BANK_ID as BANK_ID2_90_, platnosc0_.EMPLOYEE_ID as EMPLOYEE3_90_, platnosc0_.FAKTURA_ID as FAKTURA_4_90_, platnosc0_.FAKTURA_ID1 as FAKTURA_5_90_, platnosc0_.FIRMA_ID as FIRMA_ID6_90_, platnosc0_.GRUPA_ID as GRUPA_ID7_90_, platnosc0_.KASA_ID as KASA_ID8_90_, platnosc0_.MELDUNEK_ID as MELDUNEK9_90_, platnosc0_.OSOBA_ID as OSOBA_I10_90_, platnosc0_.PLATNOSC_DATA as PLATNOS11_90_, platnosc0_.PLATNOSC_DATA_KARTY as PLATNOS12_90_, platnosc0_.PLATNOSC_DEKRET_ID as PLATNOS13_90_, platnosc0_.PLATNOSC_FK_NR as PLATNOS14_90_, platnosc0_.PLATNOSC_FORPLA as PLATNOS15_90_, platnosc0_.PLATNOSC_KOD_SYSTEMU as PLATNOS16_90_, platnosc0_.PLATNOSC_KWOTA as PLATNOS17_90_, platnosc0_.PLATNOSC_NR as PLATNOS18_90_, platnosc0_.PLATNOSC_NUMER_KARTY as PLATNOS19_90_, platnosc0_.PLATNOSC_OPIS as PLATNOS20_90_, platnosc0_.PLATNOSC_PREFIX as PLATNOS21_90_, platnosc0_.PLATNOSC_RODZAJ as PLATNOS22_90_, platnosc0_.PLATNOSC_RODZAJ_KARTY_ID as PLATNOS23_90_, platnosc0_.PLATNOSC_STATUS as PLATNOS24_90_, platnosc0_.PLATNOSC_STWORZ_ZALICZKE as PLATNOS25_90_, platnosc0_.PLATNOSC_USED as PLATNOS26_90_, platnosc0_.PLATNOSC_Z_PLATNOSC_ID as PLATNOS27_90_, platnosc0_.PLATONLINE_ID as PLATONL28_90_, platnosc0_.POKOJ_ID as POKOJ_I29_90_, platnosc0_.RACHOTW_ID as RACHOTW30_90_, platnosc0_.REZERWACJA_ID as REZERWA31_90_, platnosc0_.WALUTA_ID as WALUTA_32_90_, platnosc0_.ZALICZKA_ID as ZALICZK33_90_, platnosc0_.ZMIANA_ID as ZMIANA_34_90_ from PLATNOSC platnosc0_ where platnosc0_.PLATNOSC_ID=?
2019-10-10 17:29:46 - Initiating transaction commit
2019-10-10 17:29:46 - Committing JPA transaction on EntityManager [SessionImpl(PersistenceContext[entityKeys=[EntityKey[ekoncept.entity.Platnosc#59905], EntityKey[ekoncept.entity.Platnosc#59858], EntityKey[ekoncept.entity.Faktura#141935], EntityKey[ekoncept.entity.Platnosc#59903], EntityKey[ekoncept.entity.Platnosc#59904], EntityKey[ekoncept.entity.Stale#101]],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])]
2019-10-10 17:29:46 - Not closing pre-bound JPA EntityManager after transaction
2019-10-10 17:29:46 - Found thread-bound EntityManager [SessionImpl(PersistenceContext[entityKeys=[EntityKey[ekoncept.entity.Platnosc#59905], EntityKey[ekoncept.entity.Platnosc#59858], EntityKey[ekoncept.entity.Faktura#141935], EntityKey[ekoncept.entity.Platnosc#59903], EntityKey[ekoncept.entity.Platnosc#59904], EntityKey[ekoncept.entity.Stale#101]],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])] for JPA transaction
2019-10-10 17:29:46 - Creating new transaction with name [ekoncept.service.PlatnoscServiceImpl.getRodzajTextForPlatnoscRodzaj]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
2019-10-10 17:29:46 - Exposing JPA transaction as JDBC transaction [org.springframework.orm.jpa.vendor.HibernateJpaDialect$HibernateConnectionHandle@5cc07ca4]
2019-10-10 17:29:46 - Found thread-bound EntityManager [SessionImpl(PersistenceContext[entityKeys=[EntityKey[ekoncept.entity.Platnosc#59905], EntityKey[ekoncept.entity.Platnosc#59858], EntityKey[ekoncept.entity.Faktura#141935], EntityKey[ekoncept.entity.Platnosc#59903], EntityKey[ekoncept.entity.Platnosc#59904], EntityKey[ekoncept.entity.Stale#101]],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])] for JPA transaction
2019-10-10 17:29:46 - Participating in existing transaction
2019-10-10 17:29:46 - select stale0_.STALE_ID as STALE_ID1_134_0_, stale0_.STALE_CENTRUM_PRZYCH as STALE_CE2_134_0_, stale0_.STALE_KOD_SYSTEMU as STALE_KO3_134_0_, stale0_.STALE_KONTOKSIEGOWE_ID as STALE_KO4_134_0_, stale0_.STALE_NAZWA as STALE_NA5_134_0_, stale0_.STALE_RODZAJ_ID as STALE_RO6_134_0_, stale0_.STALE_WARTOSC as STALE_WA7_134_0_, stale0_.STALE_WARTOSC2 as STALE_WA8_134_0_, stale0_.STALE_WARTOSC3 as STALE_WA9_134_0_, stale0_.STALE_WARTOSC_EN as STALE_W10_134_0_, stale0_.STALE_WARTOSC_FLOAT as STALE_W11_134_0_, stale0_.STALE_WARTOSC_INT as STALE_W12_134_0_, stale0_.STALE_WARTOSC_INT2 as STALE_W13_134_0_, stale0_.STALE_WIDOCZNOSC as STALE_W14_134_0_ from STALE stale0_ where stale0_.STALE_ID=?
2019-10-10 17:29:46 - Initiating transaction commit
2019-10-10 17:29:46 - Committing JPA transaction on EntityManager [SessionImpl(PersistenceContext[entityKeys=[EntityKey[ekoncept.entity.Stale#402], EntityKey[ekoncept.entity.Stale#101], EntityKey[ekoncept.entity.Platnosc#59905], EntityKey[ekoncept.entity.Platnosc#59858], EntityKey[ekoncept.entity.Faktura#141935], EntityKey[ekoncept.entity.Platnosc#59903], EntityKey[ekoncept.entity.Platnosc#59904]],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])]
2019-10-10 17:29:46 - Not closing pre-bound JPA EntityManager after transaction
2019-10-10 17:29:46 - Found thread-bound EntityManager [SessionImpl(PersistenceContext[entityKeys=[EntityKey[ekoncept.entity.Stale#402], EntityKey[ekoncept.entity.Stale#101], EntityKey[ekoncept.entity.Platnosc#59905], EntityKey[ekoncept.entity.Platnosc#59858], EntityKey[ekoncept.entity.Faktura#141935], EntityKey[ekoncept.entity.Platnosc#59903], EntityKey[ekoncept.entity.Platnosc#59904]],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])] for JPA transaction
2019-10-10 17:29:46 - Creating new transaction with name [org.springframework.data.jpa.repository.support.SimpleJpaRepository.findById]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
2019-10-10 17:29:46 - Exposing JPA transaction as JDBC transaction [org.springframework.orm.jpa.vendor.HibernateJpaDialect$HibernateConnectionHandle@2c0c9b9d]
2019-10-10 17:29:46 - select platnosc0_.PLATNOSC_ID as PLATNOSC1_90_, platnosc0_.BANK_ID as BANK_ID2_90_, platnosc0_.EMPLOYEE_ID as EMPLOYEE3_90_, platnosc0_.FAKTURA_ID as FAKTURA_4_90_, platnosc0_.FAKTURA_ID1 as FAKTURA_5_90_, platnosc0_.FIRMA_ID as FIRMA_ID6_90_, platnosc0_.GRUPA_ID as GRUPA_ID7_90_, platnosc0_.KASA_ID as KASA_ID8_90_, platnosc0_.MELDUNEK_ID as MELDUNEK9_90_, platnosc0_.OSOBA_ID as OSOBA_I10_90_, platnosc0_.PLATNOSC_DATA as PLATNOS11_90_, platnosc0_.PLATNOSC_DATA_KARTY as PLATNOS12_90_, platnosc0_.PLATNOSC_DEKRET_ID as PLATNOS13_90_, platnosc0_.PLATNOSC_FK_NR as PLATNOS14_90_, platnosc0_.PLATNOSC_FORPLA as PLATNOS15_90_, platnosc0_.PLATNOSC_KOD_SYSTEMU as PLATNOS16_90_, platnosc0_.PLATNOSC_KWOTA as PLATNOS17_90_, platnosc0_.PLATNOSC_NR as PLATNOS18_90_, platnosc0_.PLATNOSC_NUMER_KARTY as PLATNOS19_90_, platnosc0_.PLATNOSC_OPIS as PLATNOS20_90_, platnosc0_.PLATNOSC_PREFIX as PLATNOS21_90_, platnosc0_.PLATNOSC_RODZAJ as PLATNOS22_90_, platnosc0_.PLATNOSC_RODZAJ_KARTY_ID as PLATNOS23_90_, platnosc0_.PLATNOSC_STATUS as PLATNOS24_90_, platnosc0_.PLATNOSC_STWORZ_ZALICZKE as PLATNOS25_90_, platnosc0_.PLATNOSC_USED as PLATNOS26_90_, platnosc0_.PLATNOSC_Z_PLATNOSC_ID as PLATNOS27_90_, platnosc0_.PLATONLINE_ID as PLATONL28_90_, platnosc0_.POKOJ_ID as POKOJ_I29_90_, platnosc0_.RACHOTW_ID as RACHOTW30_90_, platnosc0_.REZERWACJA_ID as REZERWA31_90_, platnosc0_.WALUTA_ID as WALUTA_32_90_, platnosc0_.ZALICZKA_ID as ZALICZK33_90_, platnosc0_.ZMIANA_ID as ZMIANA_34_90_ from PLATNOSC platnosc0_ where platnosc0_.PLATNOSC_ID=?
2019-10-10 17:29:46 - Initiating transaction commit
2019-10-10 17:29:46 - Committing JPA transaction on EntityManager [SessionImpl(PersistenceContext[entityKeys=[EntityKey[ekoncept.entity.Stale#402], EntityKey[ekoncept.entity.Stale#101], EntityKey[ekoncept.entity.Platnosc#59905], EntityKey[ekoncept.entity.Platnosc#59858], EntityKey[ekoncept.entity.Faktura#141935], EntityKey[ekoncept.entity.Platnosc#59903], EntityKey[ekoncept.entity.Platnosc#59904]],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])]
2019-10-10 17:29:46 - Not closing pre-bound JPA EntityManager after transaction
2019-10-10 17:29:46 - Found thread-bound EntityManager [SessionImpl(PersistenceContext[entityKeys=[EntityKey[ekoncept.entity.Stale#402], EntityKey[ekoncept.entity.Stale#101], EntityKey[ekoncept.entity.Platnosc#59905], EntityKey[ekoncept.entity.Platnosc#59858], EntityKey[ekoncept.entity.Faktura#141935], EntityKey[ekoncept.entity.Platnosc#59903], EntityKey[ekoncept.entity.Platnosc#59904]],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])] for JPA transaction
2019-10-10 17:29:46 - Creating new transaction with name [ekoncept.service.PlatnoscServiceImpl.getRodzajTextForPlatnoscRodzaj]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
2019-10-10 17:29:46 - Exposing JPA transaction as JDBC transaction [org.springframework.orm.jpa.vendor.HibernateJpaDialect$HibernateConnectionHandle@7a494edf]
2019-10-10 17:29:46 - Found thread-bound EntityManager [SessionImpl(PersistenceContext[entityKeys=[EntityKey[ekoncept.entity.Stale#402], EntityKey[ekoncept.entity.Stale#101], EntityKey[ekoncept.entity.Platnosc#59905], EntityKey[ekoncept.entity.Platnosc#59858], EntityKey[ekoncept.entity.Faktura#141935], EntityKey[ekoncept.entity.Platnosc#59903], EntityKey[ekoncept.entity.Platnosc#59904]],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])] for JPA transaction
2019-10-10 17:29:46 - Participating in existing transaction
2019-10-10 17:29:46 - select stale0_.STALE_ID as STALE_ID1_134_0_, stale0_.STALE_CENTRUM_PRZYCH as STALE_CE2_134_0_, stale0_.STALE_KOD_SYSTEMU as STALE_KO3_134_0_, stale0_.STALE_KONTOKSIEGOWE_ID as STALE_KO4_134_0_, stale0_.STALE_NAZWA as STALE_NA5_134_0_, stale0_.STALE_RODZAJ_ID as STALE_RO6_134_0_, stale0_.STALE_WARTOSC as STALE_WA7_134_0_, stale0_.STALE_WARTOSC2 as STALE_WA8_134_0_, stale0_.STALE_WARTOSC3 as STALE_WA9_134_0_, stale0_.STALE_WARTOSC_EN as STALE_W10_134_0_, stale0_.STALE_WARTOSC_FLOAT as STALE_W11_134_0_, stale0_.STALE_WARTOSC_INT as STALE_W12_134_0_, stale0_.STALE_WARTOSC_INT2 as STALE_W13_134_0_, stale0_.STALE_WIDOCZNOSC as STALE_W14_134_0_ from STALE stale0_ where stale0_.STALE_ID=?
2019-10-10 17:29:46 - Initiating transaction commit
2019-10-10 17:29:46 - Committing JPA transaction on EntityManager [SessionImpl(PersistenceContext[entityKeys=[EntityKey[ekoncept.entity.Stale#402], EntityKey[ekoncept.entity.Stale#101], EntityKey[ekoncept.entity.Platnosc#59905], EntityKey[ekoncept.entity.Platnosc#59858], EntityKey[ekoncept.entity.Faktura#141935], EntityKey[ekoncept.entity.Platnosc#59903], EntityKey[ekoncept.entity.Platnosc#59904], EntityKey[ekoncept.entity.Stale#401]],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])]
2019-10-10 17:29:46 - Not closing pre-bound JPA EntityManager after transaction

Why Hibernate doesn't see value of field platnoscNr??为什么 Hibernate 看不到字段 platnoscNr 的值?

Refresh the entity after save.保存后刷新实体。 See the link for refresh请参阅链接以进行刷新

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM