Coder Social home page Coder Social logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 24, 2024
What about addFilter... methods that take var-args. we can't add a boolean 
parameter 
at the end. It may be okay not to use this parameter on these types of filters.

The types are currently:
IN, NOT IN, AND, OR

Original comment by dwolvert on 23 Dec 2008 at 10:06

from hibernate-generic-dao.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 24, 2024
Re: What about addFilter... methods

It's definitely okay with AND and OR. They always have this ignore if no values 
behavior.

With IN and NOT_IN, it might make sense to have these method signatures:
.addFilterIn(String prop, Collection value)
.addFilterIn(String prop, Collection value, ignoreIfNone)
.addFilterIn(String prop, Object[] value)
.addFilterIn(String prop, Object[] value, ignoreIfNone)
.addFilterIn(String prop, Collection value)
.addFilterIn(String prop, Object... value)

Because when using the varargs param, the developer is explicitly indicating the
values, so he/she will know whether there will be an empty set of values.

These method signatures would not compile, however, because (String prop, 
Object[] 
value) and (String prop, Object... value) have the same erasure. So perhaps we 
can 
change
.addFilterIn(String prop, Object... value)
to
.addFilterIn(String prop, Object firstValue, Object... otherValues)

It doesn't exactly match what we're going for, but it works nearly the same way.

Original comment by dwolvert on 2 Jan 2009 at 3:48

from hibernate-generic-dao.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 24, 2024
All this is going down the wrong trail!! For every operator but equals, null 
values 
will generate errors. There is never a case when we would not want to ignore 
nulls 
for all of these operators.

For the equals operator, we currently deal with a null value by using an SQL IS 
NULL 
operator. This may or may not be intuitive to users.

So let's just implement it so that any filter will be ignored if it has a null 
value. 
And then add IS_NULL and IS_NOT_NULL operators to replace the lost 
functionality from  
limiting the EQUALS operator. This way our operators will be consistent with 
SQL, 
which means fewer surprises for users.

Original comment by dwolvert on 2 Jan 2009 at 9:05

from hibernate-generic-dao.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 24, 2024
Changes made according to comment 3. Will be included in release 0.4.1.

Original comment by dwolvert on 5 Jan 2009 at 2:50

  • Changed state: Verified

from hibernate-generic-dao.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.