Path: csiph.com!weretis.net!feeder8.news.weretis.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=c3=b8j?= Newsgroups: comp.lang.java.programmer Subject: Re: Is there a simpler way to map Hibernate? Date: Fri, 1 Sep 2023 09:06:35 -0400 Organization: A noiseless patient Spider Lines: 26 Message-ID: References: <015e1e01-2e15-49bf-ae5e-07470e4e3d2bn@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 1 Sep 2023 13:06:35 -0000 (UTC) Injection-Info: dont-email.me; posting-host="cb85e14bf167dff1355501843a4c18ca"; logging-data="3981247"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HK4AJ1qta3Luaw4nesyoRyAsePA70bAY=" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Cancel-Lock: sha1:HTiHJTvtA4hea0ILcWQ4ZYmQ9R8= In-Reply-To: Content-Language: en-US Xref: csiph.com comp.lang.java.programmer:40005 On 9/1/2023 8:49 AM, e.d.pro...@gmail.com wrote: >> What do you have in persistence.xml? >> > I don't have a persistence.xml in this project, just the hibernatecfg.xml. > > I have another project using Hibernate through the Flowable framework which has a persistence.xml with persistence-unit tags containing class tags for every entity. > This one is just directly referencing Hibernate with session-factory. > new MetadataSources(new StandardServiceRegistryBuilder().configure().build()).getMetadataBuilder().build().getSessionFactoryBuilder().build() > try (Session session = getMyFactory().openSession();){ So you are not using JPA with Hibernate as implementation - you are using Hibernate with JPA annotations. I believe that is supposed to work, but most people changed from Hibernate with XML to JPA with annotations like 15 years ago. I have no idea about how Hibernate with JPA annotations. work. Any chance that you could change to JPA? Arne