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


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

From Hibernate to straight JPA

From Cecil Westerhof <Cecil@decebal.nl>
Newsgroups comp.lang.java.programmer
Subject From Hibernate to straight JPA
Date 2015-07-10 20:13 +0200
Organization Decebal Computing
Message-ID <87egkfhodv.fsf@Equus.decebal.nl> (permalink)

Show all headers | View raw


We are asked to change some software. At the moment one of the things
that has to be replaced is Hibernate. They want to use straight JPA,
so it is easy to switch from Hibernate, to openJPA, to …

One of the annotations that is used is:
    @NotEmpty(message = "Field is not filled")
with the import:
    import org.hibernate.validator.constraints.NotEmpty;

My college wants to use:
    @NotNull(message = "Field is not filled")
    @Size(message = "Field is not filled", min = 1)

I do not like this. It certainly is not DRY. (It is used hundreds of
times.) I prefer to define our own NotEmpty. But I have never worked
with annotations. How to do this?

Also what is a good resource to learn about JPA and annotations?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

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


Thread

From Hibernate to straight JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-07-10 20:13 +0200
  Re: From Hibernate to straight JPA Jeff Higgins <jeff@invalid.invalid> - 2015-07-11 10:56 -0400
    Re: From Hibernate to straight JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-07-11 21:06 +0200
  Re: From Hibernate to straight JPA Lew <lewbloch@gmail.com> - 2015-07-16 17:15 -0700
    Re: From Hibernate to straight JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-07-16 20:44 -0400
      Re: From Hibernate to straight JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-07-17 10:01 +0200
        Re: From Hibernate to straight JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-07-27 22:18 -0400
  Re: From Hibernate to straight JPA Eternal Hope <laughingspam99@gmail.com> - 2015-07-18 20:48 +0100
    Re: From Hibernate to straight JPA Jeff Higgins <jeff@invalid.invalid> - 2015-07-18 16:51 -0400
    Re: From Hibernate to straight JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-07-18 17:21 -0400
    Re: From Hibernate to straight JPA Martin Gregorie <martin@address-in-sig.invalid> - 2015-07-18 23:24 +0000
      Re: From Hibernate to straight JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-07-18 19:43 -0400
      Re: From Hibernate to straight JPA Jeff Higgins <jeff@invalid.invalid> - 2015-07-18 19:50 -0400
        Re: From Hibernate to straight JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-07-18 20:23 -0400
      Re: From Hibernate to straight JPA Eternal Hope <laughingspam99@gmail.com> - 2015-07-19 09:22 +0100
        Re: From Hibernate to straight JPA Jeff Higgins <jeff@invalid.invalid> - 2015-07-19 06:20 -0400
          Re: From Hibernate to straight JPA Jeff Higgins <jeff@invalid.invalid> - 2015-07-19 07:49 -0400
            Re: From Hibernate to straight JPA Eternal Hope <laughingspam99@gmail.com> - 2015-07-19 13:28 +0100
              Re: From Hibernate to straight JPA Jeff Higgins <jeff@invalid.invalid> - 2015-07-19 09:20 -0400
                Re: From Hibernate to straight JPA Jeff Higgins <jeff@invalid.invalid> - 2015-07-19 09:50 -0400
              Re: From Hibernate to straight JPA Jeff Higgins <jeff@invalid.invalid> - 2015-07-20 13:16 -0400
                Re: From Hibernate to straight JPA Jeff Higgins <jeff@invalid.invalid> - 2015-07-20 13:42 -0400
                Re: From Hibernate to straight JPA Jeff Higgins <jeff@invalid.invalid> - 2015-07-20 14:07 -0400
                Re: From Hibernate to straight JPA Eternal Hope <laughingspam99@gmail.com> - 2015-07-20 20:46 +0100
                Re: From Hibernate to straight JPA Martin Gregorie <martin@address-in-sig.invalid> - 2015-07-20 21:01 +0000
                Re: From Hibernate to straight JPA Jeff Higgins <jeff@invalid.invalid> - 2015-07-20 22:19 -0400
                Re: From Hibernate to straight JPA Jeff Higgins <jeff@invalid.invalid> - 2015-07-20 23:52 -0400
                Re: From Hibernate to straight JPA Joerg Meier <joergmmeier@arcor.de> - 2015-07-21 12:04 +0200
                Re: From Hibernate to straight JPA Eternal Hope <laughingspam99@gmail.com> - 2015-07-21 12:43 +0100
    Re: From Hibernate to straight JPA Jeff Higgins <jeff@invalid.invalid> - 2015-07-18 20:25 -0400
      Re: From Hibernate to straight JPA Jeff Higgins <jeff@invalid.invalid> - 2015-07-18 20:44 -0400

csiph-web