[hibernate-dev] [BV] Though about PatternValidator

2009-06-24 Thread Alaa Mohsen
Hello All,
 I just realized that PatternValidator checks if the String passed to it
is null or not before checking it's validity, but it doesn't check if the
String is empty. What if someone wants to put a regular expression
constraint on a non mandatory field, and the framework he uses sets this
empty field to an empty string? What do you think?

Regards
Alaa Nassef
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


[hibernate-dev] [BV] New Path API

2009-06-24 Thread Hardy Ferentschik

Hi,

I was integrating the new Path API into Hibernate Validator and here are  
some thoughts about it.


#1 Would it be worth to have a getLeafNode() method in the API. In many  
cases you need that the leaf
   and the only way to get to it at the moment is to use the Iterator. It  
would also help for my second point


#2 TraversableResolver.isReachable and TraversableResolver.isCascadable  
both take in their current version a
   Node (the leaf) and a Path (the parent path) as parameter. Why not just  
pass a Path instance. Together

   with getLeafNode() we would almost have everything we need ;-)

#3 The Path API only specifies methods to iterate existing Path instances.  
But at some stage one has to build
   these path instances as well. Since the API does not have a  
Path.addNode() (or similar) I am forced to use
   the Hibernate Validator specific PathImpl all over the place. Wouldn't  
it make sense to also add addNode()

   to the interface?

Even though ErrorBuilder pattern in ConstraintValidatorContext is quite  
nice and the API allows now for proper
validating of Maps, there are still some semantic gaps in the overall API.  
For example, Validator.validateValue
and Validator.validateProperty both take a String repesentation of the  
property to be validated. If the validation
fails the returned ConstraintValidationException contains however a Path  
instance describing the property path.
This makes it quite hard to compare the input property with the property  
in the ConstraintViolation.


I am not 100% convinced by this new Path API yet. As an internal data  
structure yes, but if it should be part of the

official API - not sure.

--Hardy
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] [BV] Though about PatternValidator

2009-06-24 Thread Hardy Ferentschik
If you want to allow the empty string you can start your regular  
expression with the 'empty' or operator '|', eg "|^.*foo.*$".

Now the string can be empty or anything with foo in it.

--Hardy

On Wed, 24 Jun 2009 09:47:56 +0200, Alaa Mohsen   
wrote:



Hello All,
I just realized that PatternValidator checks if the String passed to it
is null or not before checking it's validity, but it doesn't check if the
String is empty. What if someone wants to put a regular expression
constraint on a non mandatory field, and the framework he uses sets this
empty field to an empty string? What do you think?



___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] [BV] Though about PatternValidator

2009-06-24 Thread Alaa Mohsen
It was just a thought so that the developer doesn't have to handle such
cases himself.
regards
Alaa Nassef

On Wed, Jun 24, 2009 at 11:19 AM, Hardy Ferentschik <
hibern...@ferentschik.de> wrote:

> If you want to allow the empty string you can start your regular expression
> with the 'empty' or operator '|', eg "|^.*foo.*$".
> Now the string can be empty or anything with foo in it.
>
> --Hardy
>
>
> On Wed, 24 Jun 2009 09:47:56 +0200, Alaa Mohsen 
> wrote:
>
>  Hello All,
>> I just realized that PatternValidator checks if the String passed to it
>> is null or not before checking it's validity, but it doesn't check if the
>> String is empty. What if someone wants to put a regular expression
>> constraint on a non mandatory field, and the framework he uses sets this
>> empty field to an empty string? What do you think?
>>
>
>
>
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] [BV] Though about PatternValidator

2009-06-24 Thread Emmanuel Bernard
I'd rather see frameworks understand that "" is not equivalent to  
null :)
I know Oracle DB does not think that way but any decent human being  
does.




On  Jun 24, 2009, at 13:25, Alaa Mohsen wrote:

It was just a thought so that the developer doesn't have to handle  
such cases himself.

regards
Alaa Nassef

On Wed, Jun 24, 2009 at 11:19 AM, Hardy Ferentschik > wrote:
If you want to allow the empty string you can start your regular  
expression with the 'empty' or operator '|', eg "|^.*foo.*$".

Now the string can be empty or anything with foo in it.

--Hardy


On Wed, 24 Jun 2009 09:47:56 +0200, Alaa Mohsen > wrote:


Hello All,
I just realized that PatternValidator checks if the String passed to  
it
is null or not before checking it's validity, but it doesn't check  
if the

String is empty. What if someone wants to put a regular expression
constraint on a non mandatory field, and the framework he uses sets  
this

empty field to an empty string? What do you think?



___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


[hibernate-dev] Hibernate Core 3.3.2 is released

2009-06-24 Thread Steve Ebersole
Hibernate Core 3.3.2 just got released -
http://in.relation.to/11885.lace

On to some 3.5 work.

-- 
Steve Ebersole 
Hibernate.org

___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


[hibernate-dev] Can we have an update on Maven central repository syncing?

2009-06-24 Thread Max Bowsher
With Hibernate Core 3.3.2 just released, it seems like a relevant time
to ask:

What happened to the ongoing struggle to get jboss artifacts synced to
maven central?

Could we please have an update of what the current status is?

Thanks,
Max.



signature.asc
Description: OpenPGP digital signature
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev