Hi all!
I'm trying to create a HQl query with a null value in the where clause...
This is my class:
Code:
public class Reservation implements Serializable
{
private Long code;
private TravelFileHeader travelFileHeader;
private String fileName;
private Calendar creationDate;
private Calendar startDate;
private Calendar endDate;
private Reservation controlReservation;
private Reservation replacesReservation;
private Reservation isReplacedByReservation;
private boolean isOnRequest;
private Service service;
private ParsysUser parsysUser;
private String confirmationStatus;
private BranchOffice branchOffice;
private String reservationType;
private Set comments;
//getters and setters follows...
}
So what I'm trying to do is to get all the reservations form Rservation table where isReplacedByReservation is null....
Code:
List rsList = HibernateSession.currentSession().createQuery("from Reservation as res where res.travelFileHeader.code = " + travelFile.getCode().longValue() + " and res.isReplacedByReservation = null").list();
But I get no records back... how should I do this correctly?
Thanks in advance