File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes type casting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "type casting" Watch "type casting" New topic
Author

type casting

sharaf navas
Greenhorn

Joined: Aug 01, 2006
Posts: 25
hi all
please tell me how do i type cast a Object to a List;
please give me some exameple codes;

my Since i'm devoleping a hibernate app it may be confusing for a begginers any how here is
/////////////////////////////////////////////////////////
class EmployeeDAO {
public List findAll(EmployeeVO employeeVO)throws DataAccessLayerException{
List obj= null;
try{
startOperation();
Query qry=session.createQuery("from com.tt.notification.vo.EmployeeVO");
obj=qry.list();

}
catch(HibernateException e){
handleException(e);
}
finally {
HibernateFactory.close(session);
}
return obj;
}
}
////////////////////////

class empTest
{
/***
main method

*/

public void testFindAll()throws NotificationException{
EmployeeDAO empDao = new EmployeeDAO();
EmployeeVO employeeVO = new EmployeeVO();
List li= empDao.findAll(employeeVO);

}
//////////////
please help me thanks in advance
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336



JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
 
subject: type casting
 
Similar Threads
Saving List Of Objects from JSP through Struts 1.3 Form Bean
Problem in composite key mapping in eclipselink
Hibernate No Class Def FoundError
Logic Iterate
Error while Proxying DAO Classes