0 votes

We are using different database names in one model. We are always defining the table name (ORM Properties) to provide also the database name. Would be nice if this can be autofilled based on region and table name. We are also using a prefix in database names because of customer/brand names. To define a prefix would also be awesome.

Example:
Customer name: skipper -> prefix defined in settings: skipper_
Region: crm
Entity: customer
= tablename: skipper_crm.customer

Right now our table names are pretty long and to always write them down in table can evoke typing errors.

in Solved by (430 points)
recategorized by

2 Answers

0 votes
Best answer

Your suggestion is just defining a prefix for the entity name, or?
I want to add values in property "table" or "schema". Is that also possible? I have not found a example for that.

by (430 points)
selected by

Hi, it's not a problem to define also "table" property. You have to define complete template including "orm-attributes" elements. The easiest way is to check skipper project file and copy fragment from it.

You need something like this:

<template element='entity' use-case='create'>
  <entity name="skipper_{module}."/>
      <orm-attributes>
         <attribute name="table">{module}</attribute>
      </orm-attributes> 
   </entity>
</template>

You can find more information about templates including examples in our help site:

http://help.skipper18.com/expert-usage/customization/extending-templates
http://help.skipper18.com/expert-usage/customization/template-library

Works like a charm! Thanks!

0 votes

This can be managed by adding custom templates. However only the prefix/region can be defined automatically - the templates are applied before the entity is created, so the name of the entity itself is unknown.

This template should look like this:

<template element='entity' use-case='create'>
  <entity name="skipper_{module}."/>
</template>

You can find more about the templates here:
http://help.skipper18.com/en/extending-templates

by Skipper developer (74.8k points)
[Solved] Templates not used

Your suggestion is just defining a prefix for the entity name, or?

I want to add values in property "table" or "schema". Is that also possible? I have not found a example for that.