Dear Henning, you might try if setting the expose primary key flag to false, inside the datastore params in your app-schema mappings fixes the issue: <Parameter> <name>Expose primary keys</name> <value>false</value> </Parameter> I'm not sure 100% sure it will work for your use case, but in this way GeoServer will generate random UUID for features FID instead of using the database primary key and if the same instance is not reused across feature chaining should lead to the desired result (however not exposing pk will probably cause performance degradation when querying the data). If this does not work then I believe that code changes after a careful code investigation are needed in order to support your use case.
Kind Regards, Marco Volpini == GeoServer Professional Services from the experts! Visit http://bit.ly/gs-services-us for more information. == Marco Volpini Software Engineer GeoSolutions Group phone: +39 0584 962313 fax: +39 0584 1660272 https://www.geosolutionsgroup.com/ http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail. On Thu, Oct 6, 2022 at 9:31 AM Henning Lorenz <henning.lor...@geo.uu.se> wrote: > geoserver 2.21.1, Postgresql > > Hello, > > Question: How can I add randomness to App Schema idExpression while > joining support is active? (then random() is not supported) > > Background: > > - App Schema automatically encodes the ids based on > <tablename>.<primarykey>. > - Ids have to be unique within the output document, else the document > will not validate. > > If a mapping file repeatedly chains the same feature and there the same > content (same line in the table, same primary key), the generated id is the > same. (For me this happens with a mapping file that chains responsible > party (gmd:CI_ResponsibleParty) in several places. When the same party is > responsible more than once, the generated ids are the same and thus, the > output document does not validate). > > As all data are the same in these multiple occurrences, the only solution > I see is to add a random string/number. To concatenate random() in the > idExpression is a solution in case joining support is deactivated. However, > with activated joining support, it generates an error (only database > functions are supported, as indicated in the documentation). But when I > turn of joining support, JDBC multi values support seems to be deactivated > as well. Thus, this is not a solution. Therefore, I need a solution for > adding randomness while joining support is active. > > Thanks in advance for any help on this topic, > > Henning > > The funny thing is that the same app schema mapping with random() and > multiple values did work and produce valid output on a now decommissioned > server. The geoserver version was in the range 2.14-2.16, and I can't > recall whether joining support was active. Maybe it just was a coincidence, > or something has changed in geoserver. > > > > > > > > > När du har kontakt med oss på Uppsala universitet med e-post så innebär > det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör > det kan du läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/ > > E-mailing Uppsala University means that we will process your personal > data. For more information on how this is performed, please read here: > http://www.uu.se/en/about-uu/data-protection-policy > _______________________________________________ > Geoserver-users mailing list > > Please make sure you read the following two resources before posting to > this list: > - Earning your support instead of buying it, but Ian Turton: > http://www.ianturton.com/talks/foss4g.html#/ > - The GeoServer user list posting guidelines: > http://geoserver.org/comm/userlist-guidelines.html > > If you want to request a feature or an improvement, also see this: > https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer > > > Geoserver-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geoserver-users >
_______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users