Note! Translation of Norwegian entity / attribute names to English must be done
Created by: tsodring
When working on the OData parser, I noticed that our domain model is in English, but the OData query syntax uses Norwegian entity/attribute names. So we need to map a OData URL like
http://localhost/noark5v4/api/arkivstruktur/arkiv?$filter=startsWith(tittel,
to
select * from fonds where owned_by ='admin' and title LIKE 'hello%'
In no.arkivlab.hioa.nikita.webapp.run.AfterApplicationStartup there is a method populateTranslatedNames that populates a Constants map that has the mapping. This is just using a Constant values defined in nikita.config.N5ResourceMappings;
Here is the issue, the constant values need to be translated to English, both for SQL column names and HQL column names. It's a tedious job, but has to be done!
We are trying to handle translating OData commands in SQL / HQL and Elasticsearch queries. I think it's worthwhile pursuing this in parallel in order to make sure we don't limit the parser in some way. But we will probably just be using the HQL approach.
Someone else might find the other approaches useful!