Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!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: What is the meaning of these two required fields Date: Thu, 30 Jul 2015 04:49:21 -0400 Organization: A noiseless patient Spider Lines: 27 Message-ID: References: <87mvyersis.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 30 Jul 2015 08:52:22 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="8e164d158183579609bf09837dee5210"; logging-data="25640"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19da4VuXfxn0ZJMTDFXw2lCPG0aVA9/qmk=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 In-Reply-To: <87mvyersis.fsf@Equus.decebal.nl> Cancel-Lock: sha1:yaSvSko2VHth0/y6bfN6oCUCbyc= Xref: csiph.com comp.lang.java.programmer:32205 On 07/30/2015 03:52 AM, Cecil Westerhof wrote: > I wrote my own annotation: > // public > @Documented > @Constraint(validatedBy = {}) > @Target({ FIELD }) > @Retention(RUNTIME) > @ReportAsSingleViolation > @NotNull > @Size(min = 1) > public @interface NotEmpty { > // default > Class[] groups() default { }; > String message() default "Field should be filled"; > Class[] payload() default {}; > } > > I understand the reason for message: that is the message for when > there is a validation constraint. > > But what are the reasons for groups and payload? > And just ignore the Hibernate extensions if you like.