Ops, I wanted to say: NativeNamedQuery and the method should return a list, not a entity. I used a sample of the documentation and add the hint to show my example. (I'm fixing it in documentation now)
On Thu, Jun 11, 2015 at 11:57 AM, Daniel Cunha <daniels...@gmail.com> wrote: > Hi Akm, > > Maybe, you can do something like: > > ``` > public abstract class PersonRepository extends > AbstractEntityRepository<Person, Long> > { > > public Person findBySSN(String ssn) > { > return typedQuery("select p from Person p where p.ssn = ?1") > .setParameter(1, ssn) > .setHint("xpto","xpto-value") > .getResultList(); > } > > } > ``` > > Or, you can use NamedQuery/NativeQuery. > > We've this two solutions, ATM. (If I remember well, please DS guys, talk > more if I forget something) > If you have some another idea, please, share it and maybe we can discuss > and implement it or you can present a some solution with a patch/Pull > Request. > > > On Thu, Jun 11, 2015 at 10:37 AM, akm <ameh...@ford.com> wrote: > >> We are piloting DeltaSpike Data Module in our enterprise. >> >> Our requirements are to add a query hint to bypass cache for the find >> methods since most of our applications need to get the latest data from >> the >> database as the records may be directly inserted or updated in the >> database. >> I cannot find a way to add hints to the repository find method. >> Is there a way to do this? >> >> Thanks for the help. >> >> >> >> >> -- >> View this message in context: >> http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/DeltaSpike-Data-Module-Repository-tp4660831.html >> Sent from the Apache DeltaSpike Incubator Discussions mailing list >> archive at Nabble.com. >> > > > > -- > Best regard, > Daniel Cunha (soro) > -- Best regard, Daniel Cunha (soro)