Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #40012

Re: Is there a simpler way to map Hibernate?

X-Received by 2002:ac8:7dc3:0:b0:412:14a0:448e with SMTP id c3-20020ac87dc3000000b0041214a0448emr206957qte.1.1694431167205; Mon, 11 Sep 2023 04:19:27 -0700 (PDT)
X-Received by 2002:a05:690c:f08:b0:586:e91a:46c2 with SMTP id dc8-20020a05690c0f0800b00586e91a46c2mr456433ywb.4.1694431166806; Mon, 11 Sep 2023 04:19:26 -0700 (PDT)
Path csiph.com!1.us.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.programmer
Date Mon, 11 Sep 2023 04:19:26 -0700 (PDT)
In-Reply-To <udlo4l$otip$1@dont-email.me>
Injection-Info google-groups.googlegroups.com; posting-host=98.237.40.232; posting-account=2czF5goAAAD4GBMPIGV4KcD2K4PhoB_H
NNTP-Posting-Host 98.237.40.232
References <015e1e01-2e15-49bf-ae5e-07470e4e3d2bn@googlegroups.com> <ucr57u$3fa1g$1@dont-email.me> <c7dbfc66-c143-45f0-8501-50d9aa90e3b2n@googlegroups.com> <ucslb3$3p6nj$1@dont-email.me> <f0746a5b-9125-4055-b2a4-de230c621f6cn@googlegroups.com> <ucsnkr$3pftv$1@dont-email.me> <69105518-21d7-468c-9774-e9ffb497677fn@googlegroups.com> <ucspf7$3ppii$1@dont-email.me> <74cf0893-49c0-46dc-8381-92244f60bde1n@googlegroups.com> <udlo4l$otip$1@dont-email.me>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <4d753bdf-e14f-416b-97c2-254de83c55b7n@googlegroups.com> (permalink)
Subject Re: Is there a simpler way to map Hibernate?
From "e.d.pro...@gmail.com" <e.d.programmer@gmail.com>
Injection-Date Mon, 11 Sep 2023 11:19:27 +0000
Content-Type text/plain; charset="UTF-8"
X-Received-Bytes 2139
Xref csiph.com comp.lang.java.programmer:40012

Show key headers only | View raw


> > This is confusing. I've been implementing the openSession using 
> > try-with-resources. org.hibernate.Session extends 
> > javax.persistence.EntityManager (I'm using Hibernate 5x since 6x 
> > requires newer Java, stuck using Java 8 for now) as well as 
> > Autocloseable. EntityManager is not autocloseable,
> If Session extends EntityManager you should be able to 
> use the JPA methods on Session and just use Session auto closeable 
> feature. 
> 
> Arne

So just use EntityManagerFactory instead of SessionFactory, then just call .unwrap(Session.class) and nothing needs to change but the factory?

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Is there a simpler way to map Hibernate? "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2023-08-31 04:49 -0700
  Re: Is there a simpler way to map Hibernate? Arne Vajhøj <arne@vajhoej.dk> - 2023-08-31 18:46 -0400
    Re: Is there a simpler way to map Hibernate? "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2023-09-01 04:08 -0700
      Re: Is there a simpler way to map Hibernate? Arne Vajhøj <arne@vajhoej.dk> - 2023-09-01 08:27 -0400
        Re: Is there a simpler way to map Hibernate? "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2023-09-01 05:49 -0700
          Re: Is there a simpler way to map Hibernate? Arne Vajhøj <arne@vajhoej.dk> - 2023-09-01 09:06 -0400
            Re: Is there a simpler way to map Hibernate? "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2023-09-01 06:25 -0700
              Re: Is there a simpler way to map Hibernate? Arne Vajhøj <arne@vajhoej.dk> - 2023-09-01 09:37 -0400
                Re: Is there a simpler way to map Hibernate? "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2023-09-01 12:48 -0700
                Re: Is there a simpler way to map Hibernate? "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2023-09-05 12:34 -0700
                Re: Is there a simpler way to map Hibernate? Arne Vajhøj <arne@vajhoej.dk> - 2023-09-10 20:48 -0400
                Re: Is there a simpler way to map Hibernate? "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2023-09-11 04:19 -0700
                Re: Is there a simpler way to map Hibernate? "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2023-09-11 05:23 -0700

csiph-web