Re: [hibernate-dev] hooking native MongoDB queries on mapped entities

2013-04-16 Thread Davide D'Alto
I've applied the changes following Emmanuel suggestions: https://github.com/DavideD/hibernate-ogm/commits/nativeq I've created a very simple implementation of SqlQuery and with this prototype it is possible to execute session.createSqlQuery(...) and entityManager.createNativreQuery(...). I've cha

Re: [hibernate-dev] hooking native MongoDB queries on mapped entities

2013-04-11 Thread Emmanuel Bernard
On 11 avr. 2013, at 01:27, "Davide D'Alto" wrote: > > I think I would have put this contract on the dialect rather that the > > provider. What was your reasoning? > > The dialect seems involved in the conversion between the element used by the > data store (node, relationship, document, etc.

Re: [hibernate-dev] hooking native MongoDB queries on mapped entities

2013-04-10 Thread Davide D'Alto
> I think I would have put this contract on the dialect rather that the provider. What was your reasoning? The dialect seems involved in the conversion between the element used by the data store (node, relationship, document, etc.) and the representation we are using (tuple, entityKeys, etc). In

Re: [hibernate-dev] hooking native MongoDB queries on mapped entities

2013-04-10 Thread Emmanuel Bernard
That looks about right. Here are my comments. I think I would have put this contract on the dialect rather that the provider. What was your reasoning? I would not create a MondoDBOGMCursor or for sure not expose it to the API. Instead I would have two (or three) methods: - one returning the List

Re: [hibernate-dev] hooking native MongoDB queries on mapped entities

2013-04-10 Thread Davide D'Alto
I forgot to add the link to the commit: https://github.com/DavideD/hibernate-ogm/commit/c0426378671b2e73c9450b43d55e09ba8af00f3c On Wed, Apr 10, 2013 at 5:24 PM, Davide D'Alto wrote: > As an experiment I've added a method to the mongodb provider: > MongoDBDatastoreProvider#(Session session, Str

Re: [hibernate-dev] hooking native MongoDB queries on mapped entities

2013-04-10 Thread Davide D'Alto
As an experiment I've added a method to the mongodb provider: MongoDBDatastoreProvider#(Session session, String sqlString, Class entityType) With this method it is possible to execute a native query like "{ $query : { author : 'Oscar Wilde' }, $orderby : { name : 1 } }" that will return a MongoDBOg

Re: [hibernate-dev] hooking native MongoDB queries on mapped entities

2013-04-08 Thread Emmanuel Bernard
>From what I understand, this would be equivalent to the @NAtiveNamedQuery support in JPA where you define the binding between the result set and the objects. We can give it a shot. I wonder how much of this is related to the JP-QL query mechanism though and should be shared. Emmanuel On Sun 2013

Re: [hibernate-dev] hooking native MongoDB queries on mapped entities

2013-04-08 Thread Sanne Grinovero
Hi Guillaume, great, your help is always welcome but I didn't want to ask you as you still have many pull requests open. Don't you have enough on your plate already? But feel free to experiment with this idea, seems someone would need to spend some time experimenting. Sanne On 8 April 2013 08:45,

Re: [hibernate-dev] hooking native MongoDB queries on mapped entities

2013-04-08 Thread Guillaume SCHEIBEL
Hi, I'm interested by it, tell me if I can help. Guillaume 2013/4/7 Sanne Grinovero > Looks like a good idea: > https://forum.hibernate.org/viewtopic.php?f=31&t=1025793 > > Davide can you help them figuring out how to hook it all up? > > Sanne > ___

[hibernate-dev] hooking native MongoDB queries on mapped entities

2013-04-07 Thread Sanne Grinovero
Looks like a good idea: https://forum.hibernate.org/viewtopic.php?f=31&t=1025793 Davide can you help them figuring out how to hook it all up? Sanne ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hib