|Using EObjectStore to select column values [message #1064636]
||Thu, 20 June 2013 07:08
| Kacper Zając
Registered: June 2013
I have created model (domain and persistence classes) using Texo / ecore and I am using
EObjectStore.query to make database queries. For queries which result is collection
of ecore model classes it works fine.
Problem occurs, when I want to select something different. F.e. specific values from single column or use aggregate functions.
select sum(e.workingHours) from timesheet_TimeSheetEntry as e
I am getting exception like:
java.lang.IllegalStateException: The class class java.lang.Long is not managed by this ModelResolver
Class may vary - it depends on select statement. You can get same exception with java.lang.String or java.lang.Integer
Could you advise me what should I do to get this type of queries working ?
|Re: Using EObjectStore to select column values [message #1065174 is a reply to message #1065170]
||Mon, 24 June 2013 11:13
| Martin Taal
Registered: July 2009
Yes I can see the requirement, but I am bit in doubt on how to add this in a nice way while still following the idea
that an EObjectStore actually stores and retrieves EObjects.
So I can add a free format query api/method to EObjectStore to return such free-results. Or add a new eobject type in
Texo which has an array/list of objects as an efeature to store the data in there and return then a list of these
Can you enter a bugzilla for this? (with a link to this forum discussion)
Maybe I can solve it somewhat nicely while still following the api/EObjectStore concept.
On 06/24/2013 04:57 PM, Kacper Zając wrote:
> Hi Martin,
> Thanks for your reply and clarifying situation. That's the solution I was afraid of. I have seen that there's
> implemented functionality for count queries using EObjectStore, and I hoped,
> that I won't have to mix EntityManager code with EObjectStore in services.
> Actual EObjectStore, which I am using is EPersistenceService, so it's not JSONEObjectStore.
With Regards, Martin Taal
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Powered by FUDForum
. Page generated in 0.02043 seconds