I have a requirement to be able to fetch data related to a particular Date as opposed to DateTime, for a particular colmumn.
Is it at all possible to Map the related objects according to an extracted date part of a date time? Where no explicit foreign key relationship exists between the two entities?
Relating it to SQL, I would like it to generate a query as follows:
SELECT *
FROM Transactions trans
INNER JOIN TransactionDetails details
ON trans.DatePerformed = CAST(details.datetimedetails AS DATE)
The way to go in case we need the skip the mapped relationship mapping (when
CROSS JOIN
withWHERE
clause is needed) we can use HQL (only way, check e.g. here:)The HQL sytax then would be: