Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » List of Supertype and @OrderBy
List of Supertype and @OrderBy [message #388438] Thu, 28 May 2009 11:16 Go to next message
Sebastian Fuchs is currently offline Sebastian Fuchs
Messages: 94
Registered: July 2009
Member
Hi,

I am still working with Toplink Essentials but I think this is related
to EclipseLink.

I have a List<Einwirkung> where "Einwirkung" is an abstract Supertype.
"Einwirkung" holds a field "int sortIndex" which stores the runtime
order of the List elements.

To ensure the prior element order, I annotaded the List<Einwirkung> with
@OrderBy("sortIndex ASC")

When TopLink loads this list, it splits the SQL-statements according to
the concrete "Einwirkung"-Types and then aggregates the results in the
List. Please see the Logging below.
Each partial result is ordered by the SORT_INDEX field correctly but
because of the aggregation the final List is ordered first by Concrete
Type and second by SORT_INDEX.

How can I achieve that the List is orderd by the sortIndex field as
described in my annotation ?
Is this an issue and - if so - is it already fixed in EclipseLink ?

Thanks
Sebastian





[TopLink Fine]: 2009.05.28
12:38:10.578--ServerSession(1693359)--Connection(11053084)-- Thread(Thread[main,6,main])--SELECT
DISTINCT t1.EINWIRKUNG_CLASS FROM
PLATFORM.MATCH_EINWIRKUNG_ZUSAMMENSTELLUNG_EINWIRKUNG t0,
PLATFORM.EINWIRKUNG t1 WHERE ((t0.EW_ZUSST_ID = ?) AND (t1.ID =
t0.EINWIRKUNG_ID))
bind => [1]
[TopLink Fine]: 2009.05.28
12:38:10.593--ServerSession(1693359)--Connection(29720734)-- Thread(Thread[main,6,main])--SELECT
t0.ID, t0.EINWIRKUNG_CLASS, t0.SORT_INDEX, t0.NAME, t1.ID, t1.EW_TYPE,
t2.ID, t2.EW_VALUE FROM
PLATFORM.MATCH_EINWIRKUNG_ZUSAMMENSTELLUNG_EINWIRKUNG t3,
TW_GLAS.TRLV_EIGENLAST t2, PLATFORM.EINWIRKUNG_GLOBAL t1,
PLATFORM.EINWIRKUNG t0 WHERE (((t3.EW_ZUSST_ID = ?) AND (t0.ID =
t3.EINWIRKUNG_ID)) AND (((t2.ID = t0.ID) AND (t1.ID = t0.ID)) AND
(t0.EINWIRKUNG_CLASS = ?))) ORDER BY t0.SORT_INDEX ASC
bind => [1,
de.tragwerk.solution.module.tw.glas.trlv.model.einwirkung.Ei genLast]
[TopLink Fine]: 2009.05.28
12:38:10.593--ServerSession(1693359)--Connection(11053084)-- Thread(Thread[main,6,main])--SELECT
t0.ID, t0.EINWIRKUNG_CLASS, t0.SORT_INDEX, t0.NAME, t1.ID, t1.EW_TYPE,
t2.ID, t2.LAST_ANTEIL_TYPE, t2.EW_VALUE, t2.SITUATION_TYPE FROM
PLATFORM.MATCH_EINWIRKUNG_ZUSAMMENSTELLUNG_EINWIRKUNG t3,
TW_GLAS.TRLV_KLIMALAST t2, PLATFORM.EINWIRKUNG_GLOBAL t1,
PLATFORM.EINWIRKUNG t0 WHERE (((t3.EW_ZUSST_ID = ?) AND (t0.ID =
t3.EINWIRKUNG_ID)) AND (((t2.ID = t0.ID) AND (t1.ID = t0.ID)) AND
(t0.EINWIRKUNG_CLASS = ?))) ORDER BY t0.SORT_INDEX ASC
bind => [1,
de.tragwerk.solution.module.tw.glas.trlv.model.einwirkung.Kl imaLast]
[TopLink Fine]: 2009.05.28
12:38:10.609--ServerSession(1693359)--Connection(29720734)-- Thread(Thread[main,6,main])--SELECT
t0.ID, t0.EINWIRKUNG_CLASS, t0.SORT_INDEX, t0.NAME, t1.ID, t1.EW_TYPE,
t2.ID, t2.MYI, t2.EW_VALUE, t2.ANGRIFF_ORT FROM
PLATFORM.MATCH_EINWIRKUNG_ZUSAMMENSTELLUNG_EINWIRKUNG t3,
TW_GLAS.TRLV_SCHNEELAST t2, PLATFORM.EINWIRKUNG_GLOBAL t1,
PLATFORM.EINWIRKUNG t0 WHERE (((t3.EW_ZUSST_ID = ?) AND (t0.ID =
t3.EINWIRKUNG_ID)) AND (((t2.ID = t0.ID) AND (t1.ID = t0.ID)) AND
(t0.EINWIRKUNG_CLASS = ?))) ORDER BY t0.SORT_INDEX ASC
bind => [1,
de.tragwerk.solution.module.tw.glas.trlv.model.einwirkung.Sc hneeLast]
[TopLink Fine]: 2009.05.28
12:38:10.609--ServerSession(1693359)--Connection(11053084)-- Thread(Thread[main,6,main])--SELECT
t0.ID, t0.EINWIRKUNG_CLASS, t0.SORT_INDEX, t0.NAME, t1.ID, t1.EW_TYPE,
t2.ID, t2.ANGRIFF_ORT, t2.EW_VALUE, t2.SONSTIGE_EW_TYPE FROM
PLATFORM.MATCH_EINWIRKUNG_ZUSAMMENSTELLUNG_EINWIRKUNG t3,
TW_GLAS.TRLV_SONSTIGELAST t2, PLATFORM.EINWIRKUNG_GLOBAL t1,
PLATFORM.EINWIRKUNG t0 WHERE (((t3.EW_ZUSST_ID = ?) AND (t0.ID =
t3.EINWIRKUNG_ID)) AND (((t2.ID = t0.ID) AND (t1.ID = t0.ID)) AND
(t0.EINWIRKUNG_CLASS = ?))) ORDER BY t0.SORT_INDEX ASC
bind => [1,
de.tragwerk.solution.module.tw.glas.trlv.model.einwirkung.So nstigeLast]
[TopLink Fine]: 2009.05.28
12:38:10.609--ServerSession(1693359)--Connection(29720734)-- Thread(Thread[main,6,main])--SELECT
t0.ID, t0.EINWIRKUNG_CLASS, t0.SORT_INDEX, t0.NAME, t1.ID, t1.EW_TYPE,
t2.ID, t2.CPE, t2.EW_VALUE, t2.ANGRIFF_ORT FROM
PLATFORM.MATCH_EINWIRKUNG_ZUSAMMENSTELLUNG_EINWIRKUNG t3,
TW_GLAS.TRLV_WINDLAST t2, PLATFORM.EINWIRKUNG_GLOBAL t1,
PLATFORM.EINWIRKUNG t0 WHERE (((t3.EW_ZUSST_ID = ?) AND (t0.ID =
t3.EINWIRKUNG_ID)) AND (((t2.ID = t0.ID) AND (t1.ID = t0.ID)) AND
(t0.EINWIRKUNG_CLASS = ?))) ORDER BY t0.SORT_INDEX ASC
bind => [1,
de.tragwerk.solution.module.tw.glas.trlv.model.einwirkung.Wi ndLast]
[TopLink Finest]: 2009.05.28
12:38:10.625--UnitOfWork(13515618)--Thread(Thread[main,6,mai n])--Register
the existing object
de.tragwerk.solution.module.tw.glas.trlv.model.einwirkung.Ei genLast @158497c
[TopLink Finest]: 2009.05.28
12:38:10.625--UnitOfWork(13515618)--Thread(Thread[main,6,mai n])--Register
the existing object
de.tragwerk.solution.module.tw.glas.trlv.model.einwirkung.Kl imaLast @623367
[TopLink Finest]: 2009.05.28
12:38:10.625--UnitOfWork(13515618)--Thread(Thread[main,6,mai n])--Register
the existing object
de.tragwerk.solution.module.tw.glas.trlv.model.einwirkung.Kl imaLast @16602cb
[TopLink Finest]: 2009.05.28
12:38:10.625--UnitOfWork(13515618)--Thread(Thread[main,6,mai n])--Register
the existing object
de.tragwerk.solution.module.tw.glas.trlv.model.einwirkung.Kl imaLast @62be97
[TopLink Finest]: 2009.05.28
12:38:10.625--UnitOfWork(13515618)--Thread(Thread[main,6,mai n])--Register
the existing object
de.tragwerk.solution.module.tw.glas.trlv.model.einwirkung.Kl imaLast @e2b9e5
[TopLink Finest]: 2009.05.28
12:38:10.640--UnitOfWork(13515618)--Thread(Thread[main,6,mai n])--Register
the existing object
de.tragwerk.solution.module.tw.glas.trlv.model.einwirkung.Sc hneeLast @863941
[TopLink Finest]: 2009.05.28
12:38:10.640--UnitOfWork(13515618)--Thread(Thread[main,6,mai n])--Register
the existing object
de.tragwerk.solution.module.tw.glas.trlv.model.einwirkung.So nstigeLast @126fef6
[TopLink Finest]: 2009.05.28
12:38:10.640--UnitOfWork(13515618)--Thread(Thread[main,6,mai n])--Register
the existing object
de.tragwerk.solution.module.tw.glas.trlv.model.einwirkung.So nstigeLast @af4627
[TopLink Finest]: 2009.05.28
12:38:10.640--UnitOfWork(13515618)--Thread(Thread[main,6,mai n])--Register
the existing object
de.tragwerk.solution.module.tw.glas.trlv.model.einwirkung.Wi ndLast @196eed5
Re: List of Supertype and @OrderBy [message #388440 is a reply to message #388438] Fri, 29 May 2009 08:28 Go to previous message
Doug Clarke is currently offline Doug Clarke
Messages: 155
Registered: July 2009
Senior Member
Yes, we have addressed this in EclipseLink. There is a setting on the
underlying native query to use an outer join. This enables a single SQL
call where the ordering can be maintained.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=270147

I do not believe this functionality is available in TopLink Essentials.

Doug
Previous Topic:Zero = invalid primary key
Next Topic:@Lob @Column (length=16777215) doesn't work with MySql to get a MEDIUMBLOB
Goto Forum:
  


Current Time: Sat Oct 25 00:59:11 GMT 2014

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

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