Re: DeltaSpike Data Module Repository

2015-06-15 Thread Thomas Hug
Yep looks better to me. I'd be rather careful though putting this into the API (not in that form as it's not clear what it does). If we see a case later we can still expose it. On Sun, Jun 14, 2015 at 8:15 AM, Daniel Cunha daniels...@gmail.com wrote: Thomas, sounds good:

Re: DeltaSpike Data Module Repository

2015-06-12 Thread Daniel Cunha
Thomas, Sure! MethodQueryBuilder already do it. [1] I see for Delegate[2], but.. really, I don't know how to apply it here. :( [1]

Re: DeltaSpike Data Module Repository

2015-06-12 Thread Thomas Hug
Oooh I see... I should really find time to code here more often. Looks like I forgot about a lot of this code :-D Maybe a little refactoring might help to clean this up. E.g. moving the applyRestrictions into the QueryInvocationContext (resp. into a class being called by the context) so it is

Re: DeltaSpike Data Module Repository

2015-06-12 Thread Daniel Cunha
+1 On Fri, Jun 12, 2015 at 8:42 AM, Thomas Hug thomas@gmail.com wrote: Oooh I see... I should really find time to code here more often. Looks like I forgot about a lot of this code :-D Maybe a little refactoring might help to clean this up. E.g. moving the applyRestrictions into the

Re: DeltaSpike Data Module Repository

2015-06-11 Thread Daniel Cunha
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,

Re: DeltaSpike Data Module Repository

2015-06-11 Thread Daniel Cunha
you also can do: http://deltaspike.apache.org/documentation/data.html#QueryOptions21 On Thu, Jun 11, 2015 at 12:02 PM, Daniel Cunha daniels...@gmail.com wrote: Ops, I wanted to say: NativeNamedQuery and the method should return a list, not a entity. I used a sample of the documentation and

Re: DeltaSpike Data Module Repository

2015-06-11 Thread Daniel Cunha
Thomas, you're right, not work. I changed and works now[1], but I don't know if this is the better way to fix it. https://github.com/danielsoro/deltaspike/commit/bb02f14731e9c7fd5d20c255bae2a2033617a9b8 On Thu, Jun 11, 2015 at 4:11 PM, Thomas Hug thomas@gmail.com wrote: Using the

Re: DeltaSpike Data Module Repository

2015-06-11 Thread akm
Thanks for the reply. We are creating a framework that all our enterprise applications will be using; so I am looking for a generic solution that I can add in a abstract class that then all entities can use. Basically looking for something like just adding a hint to the current

Re: DeltaSpike Data Module Repository

2015-06-11 Thread Daniel Cunha
Hmm.. so, that's should work: ``` @Repository public interface SimpleRepository extends EntityRepositorySimple, Long { @Override @Query(hints = {@QueryHint(name = javax.persistence.cache.storeMode, value = BYPASS)}) ListSimple findAll(); } ``` On Thu, Jun 11, 2015 at 11:53 AM, akm

Re: DeltaSpike Data Module Repository

2015-06-11 Thread Thomas Hug
Using the @Query(hints...) is the place to set the hints with DS Data. Unfortunately (hope my memory isn't wrong) this currently doesn't work with a method expression. As soon as there's a @Query it's not considered a method expression anymore. Should not be too difficult to change - and should