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


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

Re: Is there a simpler way to map Hibernate?

Path csiph.com!news.mixmin.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: Is there a simpler way to map Hibernate?
Date Thu, 31 Aug 2023 18:46:23 -0400
Organization A noiseless patient Spider
Lines 16
Message-ID <ucr57u$3fa1g$1@dont-email.me> (permalink)
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 Thu, 31 Aug 2023 22:46:22 -0000 (UTC)
Injection-Info dont-email.me; posting-host="cb85e14bf167dff1355501843a4c18ca"; logging-data="3647536"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18IWj9rxfH6RrWJOpUUoWFyYUAwdwlTwos="
User-Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0
Cancel-Lock sha1:iKugkQcwk7n33yH9ANQK1Labck8=
Content-Language en-US
In-Reply-To <015e1e01-2e15-49bf-ae5e-07470e4e3d2bn@googlegroups.com>
Xref csiph.com comp.lang.java.programmer:40001

Show key headers only | View raw


On 8/31/2023 7:49 AM, e.d.pro...@gmail.com wrote:
> I'm reading tables by putting @Entity and @Table on classes. For each
> of those I have to add a mapping tag in the session-factory tag in a
> hibernate.cfg.xml file in the src/main/resources folder, then copy
> this tag into the same file in src/test/resources? Is there a way to
> share regular mappings with unit testing? Is there a way to
> automatically include all entities, or a reason I shouldn't want to
> include all?

If you use JPA annotations why do you need a Hibernate mapping
file at all?

Just use annotations @Id, @Column, @OneToMany on properties
to specify all the details on how to access database.

Arne

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