I am having small issue where my Object seems to to have a different value every time I do a query on it, after having updated one of its columns. This is really freaking me out.
The code I am using to do the query is:
Code:
Criteria criteria = session.createCriteria(Reservation.class);
criteria.addOrder(Order.asc("time"));
criteria.add(Expression.ge("date",startDate));
criteria.add(Expression.le("date",endDate));
and the resulting query is:
Code:
Hibernate: select this_.id as id0_, this_.title as title2_0_, this_.description as descript3_2_0_, this_.startdate as startdate2_0_, this_.enddate as enddate2_0_, this_.starttime as starttime2_0_, this_.endtime as endtime2_0_, this_.allday as allday2_0_ from closeddates this_ where this_.startdate<=? and this_.enddate>=?
and the mapping file is as follows:
Code:
<hibernate-mapping>
<class name="myco.domain.Reservation" table="reservations">
<id
name="key"
column="id"
type="integer">
<generator class="native"/>
</id>
<property
name="date"
column="resDate"
type="date"/>
<property
name="time"
column="resTime"
type="time"/>
<property
name="partySize"
column="pax"
type="integer"/>
<property
name="tableSize"
column="tableSize"
type="integer"/>
<property
name="tableNumber"
column="tableNumber"
type="integer"/>
<property
name="smoking"
column="smoking"
type="boolean"/>
<property
name="walkin"
column="walkin"
type="boolean"/>
<property
name="status"
column="status"
type="integer"/>
<property
name="comments"
column="comments"
type="string"/>
<many-to-one
name="guest"
column="guestId"
class="myco.domain.Guest"
fetch="join"
lazy="true"/>
</class>
</hibernate-mapping>
the attribute that is inconsistent in the result in "status". Any ideas?