<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'd rather see frameworks understand that "" is not equivalent to null :)<div>I know Oracle DB does not think that way but any decent human being does.</div><div><br></div><div><br></div><div><br><div><div>On Jun 24, 2009, at 13:25, Alaa Mohsen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">It was just a thought so that the developer doesn't have to handle such cases himself.<br>regards<br>Alaa Nassef<br><br><div class="gmail_quote">On Wed, Jun 24, 2009 at 11:19 AM, Hardy Ferentschik <span dir="ltr"><<a href="mailto:hibernate@ferentschik.de">hibernate@ferentschik.de</a>></span> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">If you want to allow the empty string you can start your regular expression with the 'empty' or operator '|', eg "|^.*foo.*$".<br> Now the string can be empty or anything with foo in it.<br><font color="#888888"> <br> --Hardy</font><div><div></div><div class="h5"><br> <br> On Wed, 24 Jun 2009 09:47:56 +0200, Alaa Mohsen <<a href="mailto:alaa.mohsen@egyptdc.com" target="_blank">alaa.mohsen@egyptdc.com</a>> wrote:<br> <br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hello All,<br> I just realized that PatternValidator checks if the String passed to it<br> is null or not before checking it's validity, but it doesn't check if the<br> String is empty. What if someone wants to put a regular expression<br> constraint on a non mandatory field, and the framework he uses sets this<br> empty field to an empty string? What do you think?<br> </blockquote> <br> <br> </div></div></blockquote></div><br></div> _______________________________________________<br>hibernate-dev mailing list<br><a href="mailto:hibernate-dev@lists.jboss.org">hibernate-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/hibernate-dev<br></blockquote></div><br></div></body></html>