Is it possible to specify the "sort by" when using sourceType?
<sourceDataStore>datastore</sourceDataStore>
<sourceType>GEOLOGICUNIT</sourceType>
If I want to sort by a column which is not the primary key, do I have to use View instead of Table?
Thanks
Wen
Wen,
as far as I know, it is not possible to specify a "sort by" ordering of a source type. The app-schema plugin uses the natural order of the source data store; I am not even sure if it sorts by primary key under all circumstances (such as denormalised sources when joining is not used (see the mapping file page in the manual)). If you need a particular ordering, a view seems to me like a good solution.
Kind regards,
Ben.
On 29/09/15 10:35, Yin, Wentao (IS) (Contr) wrote:
Is it possible to specify the "sort by" when using sourceType?
<sourceDataStore>datastore</sourceDataStore>
<sourceType>GEOLOGICUNIT</sourceType>
If I want to sort by a column which is not the primary key, do I have to use View instead of Table?
Thanks
Wen
------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
Ben Caradoc-Davies <ben@anonymised.com>
Director
Transient Software Limited <http://transient.nz/>
New Zealand
Thank you, Ben.
Wen
-----Original Message-----
From: Ben Caradoc-Davies [mailto:ben@…6881…]
Sent: Monday, September 28, 2015 5:54 PM
To: Yin, Wentao (IS) (Contr); geoserver-users@lists.sourceforge.net
Subject: EXT :Re: [Geoserver-users] sort on sourceType in mapping file
Wen,
as far as I know, it is not possible to specify a "sort by" ordering of a source type. The app-schema plugin uses the natural order of the source data store; I am not even sure if it sorts by primary key under all circumstances (such as denormalised sources when joining is not used (see the mapping file page in the manual)). If you need a particular ordering, a view seems to me like a good solution.
Kind regards,
Ben.
On 29/09/15 10:35, Yin, Wentao (IS) (Contr) wrote:
Is it possible to specify the "sort by" when using sourceType?
<sourceDataStore>datastore</sourceDataStore>
<sourceType>GEOLOGICUNIT</sourceType>
If I want to sort by a column which is not the primary key, do I have to use View instead of Table?
Thanks
Wen
----------------------------------------------------------------------
-------- _______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
Ben Caradoc-Davies <ben@...6881...>
Director
Transient Software Limited <http://transient.nz/> New Zealand