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?

Newsgroups comp.lang.java.programmer
Date 2023-09-11 04:19 -0700
References (5 earlier) <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>
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>

Show all headers | 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