Thanks for your reply mate but below is my code with trace
Code:
public class Samplehiber {
public static final Logger log = Logger.getLogger(Samplehiber.class);
public List DeviceLastTrack(int mid) {
List result;
Session session = HibernetUtil.getSessionFactory().openSession();
Transaction t = session.beginTransaction();
result = session.createQuery("select l.deviceId,l.managerId,d.image from lastTrack l,device m,DeviceImage d where l.deviceId=m.deviceId and m.devicedescription = d.deviceType and m.managerId=1").list();
t.commit();
session.close();
return result;
}
public static void main(String args[]) {
Samplehiber sh = new Samplehiber();
List result;
result = sh.DeviceLastTrack(1);
log.info(">>>>>>The Result is :" + result + " & size is " + result.size());
for (int i = 0; i < result.size(); i++) {
if (result.get(i) instanceof Model.lastTrack) {
log.info(">>>>>>>Object " + i + " is instance of Model.lastTrack");
} else if (result.get(i) instanceof Model.device) {
log.info(">>>>>>>Object " + i + " is instance of Model.device");
} else if (result.get(i) instanceof Model.DeviceImage) {
log.info(">>>>>>>Object " + i + " is instance of Model.DeviceImage");
} else {
log.info(">>>>>>>Object " + i + " is indetermined");
}
}
}
}
and the trace is
Quote:
Hibernate: select lasttrack0_.DeviceId as col_0_0_, lasttrack0_.ManagerId as col_1_0_, deviceimag2_.Image as col_2_0_ from lastTrack lasttrack0_, deviceMaster device1_, dimage deviceimag2_ where lasttrack0_.DeviceId=device1_.deviceid and device1_.devicedescription=deviceimag2_.DeviceType and device1_.managerId=1
11:48:46,093 INFO Samplehiber :>>>>>>The Result is :[[Ljava.lang.Object;@1fd6bea, [Ljava.lang.Object;@b7ec5d] & size is 2
11:48:46,093 INFO Samplehiber :>>>>>>>Object 0 is indetermined
11:48:46,093 INFO Samplehiber :>>>>>>>Object 1 is indetermined
I hope you got my problem,
It is unable to get conversion to any Model in iterator.
So, please Help, Thanks again