conditions

Is there any .net class for query conditions like DetachedCriteria in Hibernate, but not rely on Hibernate?

I'm writting a general DAO interface and facing a difficult in general Query operation. Query operation requires a set of query conditions. I'd like to give a interface like IList<TEntity> Query(DetachedCriteria criteria); But this makes the interface rely on nHibernate. If I want to use Linq or plain SQL, it is not easy to convert D...

Rails - Conditions Include Multiple Items In An Array

p = Person.find_by_id(1, :include => :bags, :conditions => ['bag.id in (?), [3,4]) I would like to know how I could make sure this query will only be valid if both 'items.id' '3' & '4' are present rather than '3' or/and '4'. Thanks ...

How can I do a find in Rails with conditions set on the join table of a :through association?

I have the following models: class User < ActiveRecord::Base has_many :permissions has_many :tasks, :through => :permissions class Task < ActiveRecord::Base has_many :permissions has_many :users, :through => :permissions class Permission < ActiveRecord::Base belongs_to :task belongs_to :user I want to be able to display ...

Mysql - Can you check for both a blank string and 0 in one condition?

I want to check in mysql if a column is either blank, ie '', or 0. Is there a way to do this with one condition? Like WHERE order_id > '' or WHERE order_id != '' Would either of these work, or is there a different solution? ...

How do I query an object collection using user defined conditions?

Sorry if this is a little abstract. I'm in the early stages of development. I have two object types: An object that needs to store a series of user defined conditions. An object that matches zero or more of the conditions defined in the first object. Here's a simple example of how it would run. A user creates several objects of ty...