On 10/03/06, Dierk Koenig <
[hidden email]> wrote:
> Hi,
>
> in constraints, we have
>
> length
> minLength
> maxLength
>
> size
> minSize
> maxSize
>
> min
> max
> range
Yeh I decided to have all these as they make sense for different
types, size doesn't in my opinion make sense for a string. And 'range'
makes more sense when you're talking about dates or numbers.
Internally they actually use the same code
>
> I understand min/max/range work on the value
> while all the others work on the cardinality.
>
> However, I think we could consolidate the length
> and size variants into using only the size ones,
> duck typing on 'size()-able' so to speak.
Maybe.
>
> -> easier to remember.
>
> Mittie
>
> P.S. How about using the Groovy classifier
> mechanism isCase()?
>
> foo(case: ~/.../)
> foo(case: {it > 10} )
> foo(case: [1,2,3] )
Great idea! How do i access this from java though?
>
> just an idea. Probably not helpful for creating
> DB constraints (is Grails doing that?).
No not at the moment, its auto generating the database, but just using
what Hibernate defaults to for different types. It is assumed that in
the real world one would actually create the database with a SQL
script or such like rather than auto-generating it.
Also for 0.2 we plan to use GSQL to make a db easier to define
Graeme
>
> cheers
> Mittie
>
>
>
>
>
>
>