Here are the abbreviated HBM files:
------------------------------------------------------
<hibernate-mapping>
<class name="Market" table="market">
<id name="id" column="Market_ID" type="long">
<generator class="native"/>
</id>
<property name="marketAbbrev" column="marketAbbrev" " type="string"/>
<set name="downLogs">
<key column="Market_ID" />
<one-to-many class="DownLog"/>
</set>
</class>
</hibernate-mapping>
--------------------------------------------------------------------------
<hibernate-mapping>
<class name="DownLog" table="downlog">
<id name="id" column="DownLog_ID" type="long">
<generator class="native"/>
</id>
<property name="broadcastDate" column="BroadcastDate" type="date"/>
<property name="processed" column="Processed" type="char"/>
<many-to-one name="markets" class="Market" column="Market_ID"/>
</hibernate-mapping>
-------------------------------------------------------------------------
I don't believe you can do it in the where clause because if you look at the "on" clause:
on m.market_id = d.market_id
and d.broadcastDate = ?
it joins with Market only those records from DownLog for that particular date. Now any joined records that have a field from DownLog that are null are the Markets that do not have a DownLog record for that date. I don't believe you can put broadcastdate in the "where" clause because we are looking for missing DownLog records, and that's where broadcastDate is stored.
If you know another way of doing it, I would appreciate it.
----------------------------
Frank
|