Giuseppe Contartese wrote:
> Hi,
> looking and testing SearchInfo functionality I noted with regred that
> there wasn't possibility to
> filter using (i thinkg the most popular ) restricion "is null" or "is
> not null".
> I don't want ,for sure, to replace everywhere the power of Hibernate
> Criteria but..
> As smartweb user I would like to have this functionality..I report a
> simple test case :
> Suppose i have a list of bean Contract with a "expirationDate"
> property that determ expiration time ...it can become really simple to
> filter them
> and know all expired :
> info.addFilterRestriction("dateEnd",SearchInfo.IS_NOT_NULL) !
>
> As smartweb developer I can provide their implementation and test..on
> BusinessObjectFactory and SearchInfo classes..
>
> What do u think about it ?
It would be nice if you can provide a patch and attach it to a new
feature request on the smartweb issue tracker.
Have you already thought about the character to use as indicators for
this operations?
Characters already recognized by the SearchInfo builder method are:
<, <= lesser and lesser than
>=, > greater and greater than
=, ! equals and not equals
|, %, %% between, like and ilike (the last one may need refactor)
what do you suggest for null and not null? consider those characters
cannot be part of the property name or of the search value...
as an example, you cannot pass to SearchInfo something like
property = anyName
operator = %
value = %some%
as this will be interpreted as
property = anyName
operator = %%
value = some%
the same applies to
property = anyName
operator = >
value = =mio
as it will be interpreted as
property = anyName
operator = >=
value = mio
and so on... I didn't provide any example for property name conflicts as
the used characters are not valid Java identifiers characters thus they
cannot be used in property names... but if we choose a valid Java
identifier character we can introduce more problems we solve
|