Is null or is not null ? That is the question

View: New views
2 Messages — Rating Filter:   Alert me  

Is null or is not null ? That is the question

by Giuseppe Contartese :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 ?
--
Giuseppe Contartese
mail: gcontartese@...
mobile: +393939064135
Smartlab s.r.l. via E.Q. Visconti, 103 00192 Roma
Tel. +39067886641 Fax: +391782233798

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
smartweb-user mailing list
smartweb-user@...
https://lists.sourceforge.net/lists/listinfo/smartweb-user

Re: Is null or is not null ? That is the question

by Roberto Lo Giacco-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
smartweb-user mailing list
smartweb-user@...
https://lists.sourceforge.net/lists/listinfo/smartweb-user

smime.p7s (4K) Download Attachment