diff --git a/entity/Person_entity/recordcontainers/db/recordfieldmappings/contenttitle.value/expression.js b/entity/Person_entity/recordcontainers/db/recordfieldmappings/contenttitle.value/expression.js index 89a6fc8ad6892d6f536e7887086fe7b24d323cbe..dc1aa5d98130fc5d2c838da056f5d70acc70d2af 100644 --- a/entity/Person_entity/recordcontainers/db/recordfieldmappings/contenttitle.value/expression.js +++ b/entity/Person_entity/recordcontainers/db/recordfieldmappings/contenttitle.value/expression.js @@ -1,4 +1,21 @@ +import("system.db"); import("Contact_lib"); import("system.result"); +import("system.vars"); +import("Util_lib"); +import("Contact_lib"); + +let contenttitleSQL; + +// This is need for the derby db, because the derby db don't have a REPLACE-Function, which is needed for the dissolution of the salutation +if (db.getDatabaseType(db.getCurrentAlias()) == db.DBTYPE_DERBY10) +{ + var renderer = new ContactTitleRenderer(Contact.createWithColumnPreset(), null); + contenttitleSQL = renderer.asSql(); +} +else +{ + contenttitleSQL = Contacttils.getContactSalutationSubSql(true); +} -result.string(ContactUtils.getContactSalutationSubSql(true)); \ No newline at end of file +result.string(contenttitleSQL); \ No newline at end of file