-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: dynamic @where clause filter
PostPosted: Tue Mar 02, 2010 7:07 am 
Newbie

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.