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()
- Adding a new feature : multiple choice field : HOT 3
- Spacialy enable hibernate-generic-dao HOT 3
- Invalid query when property is of type Class<?> HOT 1
- Generify search and searchUnique return signatures HOT 3
- Make sure we can handle boolean type properties
- MappedSuperclass missing from JPAAnnotationMetadata getProps() HOT 5
- Positional Parameters syntax in Query using JPA DAO HOT 3
- Search.count() does not work with composite id's HOT 4
- Possible conflict between GenericDAO and GenericDAOImpl HOT 5
- HibernateMetadataUtil causes memory leak when dealing with many session factories HOT 8
- Why setDistinct() return IMutableSearch instead of Search? HOT 3
- Hibernate 4 is unsupported HOT 2
- find() with dual primary key. HOT 1
- How to use second_level_cache in hibernate-generic-dao HOT 2
- JPAAnnotationMetadata uses java 6 java.lang.String.isEmpty() method. search-1.1.0.jar is incompatible with java 5 HOT 3
- 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.