Created
August 23, 2011 20:24
-
-
Save bittersweetryan/1166407 to your computer and use it in GitHub Desktop.
Today's Code Fail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List findByProjectContractDetailId(Long contractDetailID) { | |
logger.info("finding all ContractTaskDetail instances"); | |
try { | |
String queryString = "from ContractTaskDetail"; | |
Query queryObject = getSession().createQuery(queryString); | |
List contractTaskDetailList = queryObject.list(); | |
//um...queryObject.list returns nearly 1000000 rows hows about we write a freaking | |
//WHERE clause | |
for(Iterator it=queryObject.list().iterator(); it.hasNext(); ) | |
{ | |
ContractTaskDetail contractTaskDetail =(ContractTaskDetail)it.next(); | |
if(contractTaskDetail.getId().getProjectContractDetailID().compareTo(value1) == 0) | |
{ | |
} else { | |
contractTaskDetailList.remove(contractTaskDetail); | |
} | |
}; | |
return contractTaskDetailList; | |
} catch (RuntimeException re) { | |
logger.warning("find all failed", re); | |
throw re; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment