if (qtype == WorkflowQuery.CURRENT) { entityClass = HibernateCurrentStep.class; } else { entityClass = HibernateHistoryStep.class; }
	public List query(WorkflowQuery query) throws StoreException		{			List results = new ArrayList();			// going to try to do all the comparisons in one query			String sel;			Class entityClass;			int qtype = query.getType();			if (qtype == 0) { // then not set, so look in sub queries							  // todo: not sure if you would have a query that would look in both old and new, if so, i'll have to change this - TR							  // but then again, why are there redundant tables in the first place? the data model should probably change				if (query.getLeft() != null) {					qtype = query.getLeft().getType();				}			}			if (qtype == WorkflowQuery.CURRENT) {				entityClass = HibernateCurrentStep.class;			} else {				entityClass = HibernateHistoryStep.class;			}        			Criteria criteria = session.createCriteria(entityClass);				criteria.add(buildExpression(query));          			//get results and send them back			return results;		}  