Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Cecil Westerhof Newsgroups: comp.lang.java.programmer Subject: Re: From Hibernate to straight JPA Date: Sat, 11 Jul 2015 21:06:09 +0200 Organization: Decebal Computing Lines: 40 Message-ID: <874mlah5um.fsf@Equus.decebal.nl> References: <87egkfhodv.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="528adfd6ad074c92fdc6a7f8fb9e23d8"; logging-data="26921"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7RyjeAyxRaFXn562KmRisPQXfG2bNPvI=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:hpqdKyfs+Jo5eSY+web+YHTo5QY= sha1:o//nI1q5cwGXH7xf6Z6q+LdKISc= X-Homepage: http://www.decebal.nl/ Xref: csiph.com comp.lang.java.programmer:31992 On Saturday 11 Jul 2015 16:56 CEST, Jeff Higgins wrote: > On 07/10/2015 02:13 PM, Cecil Westerhof wrote: >> 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? >> > > Since no response so far I'll throw in my search results. > May be bunk as I'm not a JPA or JavaEE user. > > > > I did find a 20 links, but found it a ‘little’ overwhelming. Did not find you first two links. Added them to my list. Thanks. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof