Comments (4)
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.
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.
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.
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)
- Entity not being saved HOT 2
- Implement MetadataUtil for JPA 2 metadata model
- JPAAnnotationMetadata only accepts direct public fields in getProps()
- Add Enumeration support to InternalUtil.convertIfNeeded()
- Version 1.1.3 InExpression can not handle values not null but without any elements
- Nested property fetches dont work (first identified in issue 56) HOT 1
- JPABaseDAO - java.lang.NoSuchMethodError HOT 2
- NoSuchMethodError HOT 2
- Sample Projects do have a wrong dao-hibernate version in their poms
- Sample Project hibernate-maven-web does nut run under jetty (?) HOT 1
- How to compare to fields using ==, <=, >= , > , < operators HOT 3
- Search.removeField(property) not work HOT 1
- UUID HOT 1
- GenericDAO Search failed with boolean Column HOT 2
- Not compatible with the latest hibernate
- Issue with Distinct with hibernate 4.3,5 HOT 1
- OP_LIKE is not working
- left join fetch is not working.
- Issue when Implementing Ehcache
- Hibernate 4 Upgrade HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hibernate-generic-dao.