Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Jeff Higgins Newsgroups: comp.lang.java.programmer Subject: Re: From Hibernate to straight JPA Date: Sat, 11 Jul 2015 10:56:47 -0400 Organization: A noiseless patient Spider Lines: 28 Message-ID: References: <87egkfhodv.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 11 Jul 2015 14:58:55 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="8e164d158183579609bf09837dee5210"; logging-data="3554"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+G8v01l/LRmKLlCfP+AkWlBZ5nZ2tukZA=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 In-Reply-To: <87egkfhodv.fsf@Equus.decebal.nl> Cancel-Lock: sha1:4QIOs/Grc1jasbsi2pQuLkaaVn4= Xref: csiph.com comp.lang.java.programmer:31991 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.