Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Teneo: It is impossible to specify queries order for Hibernate resource
Teneo: It is impossible to specify queries order for Hibernate resource [message #68367] Fri, 19 January 2007 14:15 Go to next message
Ilya Klyuchnikov is currently offline Ilya KlyuchnikovFriend
Messages: 74
Registered: July 2009
Member
I load very big model from db.

I have optimized the queries (and their order) for loading model. But
HibernateResource is agnostic to query order cause when it parses URI it
puts queries into HashSet and then cannot restore order of queries.

Can it be solved?

Thanks

Ilya
Re: Teneo: It is impossible to specify queries order for Hibernate resource [message #68387 is a reply to message #68367] Fri, 19 January 2007 14:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Ilya,

Not that I know any of the details, but perhaps if a LinkedHashSet were
used, the order would be more deterministic...


Ilya Klyuchnikov wrote:
> I load very big model from db.
>
> I have optimized the queries (and their order) for loading model. But
> HibernateResource is agnostic to query order cause when it parses URI
> it puts queries into HashSet and then cannot restore order of queries.
>
> Can it be solved?
>
> Thanks
>
> Ilya
Re: Teneo: It is impossible to specify queries order for Hibernate resource [message #68395 is a reply to message #68387] Fri, 19 January 2007 16:10 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Ilya,
What happens is the following: the parameters in the queryset (of the uri) are put in a hashmap
(keyed on parameter name). The getqueries method then retrieves the query parameters from the
hashmap. I can change this by using a treemap instead of a hashmap. This is a small change and will
make the retrieval order of the queries more deterministic (in order of their parameter name).
Please enter a bugzilla for this as well.

Btw you can override getqueries to implement this yourselve for now.

gr. Martin

Ed Merks wrote:
> Ilya,
>
> Not that I know any of the details, but perhaps if a LinkedHashSet were
> used, the order would be more deterministic...
>
>
> Ilya Klyuchnikov wrote:
>> I load very big model from db.
>>
>> I have optimized the queries (and their order) for loading model. But
>> HibernateResource is agnostic to query order cause when it parses URI
>> it puts queries into HashSet and then cannot restore order of queries.
>>
>> Can it be solved?
>>
>> Thanks
>>
>> Ilya


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo: It is impossible to specify queries order for Hibernate resource [message #601411 is a reply to message #68367] Fri, 19 January 2007 14:29 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Ilya,

Not that I know any of the details, but perhaps if a LinkedHashSet were
used, the order would be more deterministic...


Ilya Klyuchnikov wrote:
> I load very big model from db.
>
> I have optimized the queries (and their order) for loading model. But
> HibernateResource is agnostic to query order cause when it parses URI
> it puts queries into HashSet and then cannot restore order of queries.
>
> Can it be solved?
>
> Thanks
>
> Ilya


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Teneo: It is impossible to specify queries order for Hibernate resource [message #601413 is a reply to message #68387] Fri, 19 January 2007 16:10 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Ilya,
What happens is the following: the parameters in the queryset (of the uri) are put in a hashmap
(keyed on parameter name). The getqueries method then retrieves the query parameters from the
hashmap. I can change this by using a treemap instead of a hashmap. This is a small change and will
make the retrieval order of the queries more deterministic (in order of their parameter name).
Please enter a bugzilla for this as well.

Btw you can override getqueries to implement this yourselve for now.

gr. Martin

Ed Merks wrote:
> Ilya,
>
> Not that I know any of the details, but perhaps if a LinkedHashSet were
> used, the order would be more deterministic...
>
>
> Ilya Klyuchnikov wrote:
>> I load very big model from db.
>>
>> I have optimized the queries (and their order) for loading model. But
>> HibernateResource is agnostic to query order cause when it parses URI
>> it puts queries into HashSet and then cannot restore order of queries.
>>
>> Can it be solved?
>>
>> Thanks
>>
>> Ilya


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:Teneo: It is impossible to specify queries order for Hibernate resource
Next Topic:Teneo newbi, problems getting started
Goto Forum:
  


Current Time: Tue Apr 23 17:08:57 GMT 2024

Powered by FUDForum. Page generated in 0.03073 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top