Joined: Tue Mar 02, 2010 6:33 am Posts: 1
|
Hello,
I would like to know if it is possible to configure dynamic @where clauses with hibernate anotations. Let's say I have a relationship between two classes - company (parent) and invoces (child).
If have a Annotation declaration like this (pseudo code).
@OneToMany @JoinColumn (name = "company_id") @Where(clause="invoice_month=:month") private Set invoices = new HashSet();
public function getInvoces(Date date) { return invoices; // filtered please! }
What I would like to do now is to connect the passed Date in the getInvoice(Date date) function to the @Where clause of the Annotation (:moth) to filter data. The result should return only Invoces by the given Date.
Is there a way how to do it?
Thanks in advance Dennis
|
|