oql.bind(true);
QueryResults results = oql.execute(Database.READONLY);
while (results.hasMore())
{
GeneralOQLResult resultBean = (GeneralOQLResult)results.next();
Integer versionStateId = new Integer(resultBean.getValue1());
if(resultBean.getId() != null && resultBean.getValue1() != null && versionStateId.equals(stateId))
contentVersionIdList.add(resultBean.getId());
}
results.close();
oql.close();