Hi,
I am using the HQL query
select ct.id, ct.firstName from Contact ct
I am querying only 2 fields where there are 4 fields in the table.
So I cannot use the following code since number of elements in the class and query does not match
Contact ct=(Contact)it.next();
System.out.println("ID: " + ct.getId());
System.out.println("First Name: " + ct.getFirstName());
where Contact is the classname and 'it' is an iterator object
I know how to do it with object array.
But I want to know is there any method or API using that I can still use an object of the 'Contact' class to store the result and show the values using getter methods?
Thanks and Regards,
Jacob Baby
|