Synonyms in Oracle Database projects can be created in Luna Modeler as other objects and displayed as simple graphical representatives with custom colors. Synonyms can be created for
- objects that exist in the project
- external objects
In certain scenarios, the synonyms can be used as reusable items and assigned to table columns as data types.
Creating Basic Oracle Database Synonyms
To add a new synonym, click Other on the main toolbar and select Synonym from the drop-down.

Then click the diagram area to place a new graphical representative to the desired position.
You can also add new object via context menu:

In the right-side panel, you can specify the Name (1) for the Synonym and choose the target object from the For drop down (2).

Creating Synonyms for Types
Types can be defined in projects for Oracle Database. Types can be used as data types for table columns, and synonyms can be created for the defined types.
On the screenshot below you can see type PRODUCT_TYPE. Let’s create a new synonym ARTICLE for PRODUCT_TYPE. Add a new synonym, specify name and choose the PRODUCT_TYPE from the drop down.

Now both the PRODUCT_TYPE as well as the ARTICLE synonym can be assigned to a table column the same same way as standard data types.
See how to change the datatype for column PRODUCTS in table CART.

Creating Synonyms for External Objects
In Luna Modeler you can also create synonyms for external objects, for example for objects from other schema etc.
To create a synonym for an external object, select item External object (not in the project) item from the For drop-down. Then specify Object type, Object schema and Object name values.

In case the external object Type, the item can be assigned to table columns. In the example below, you can see a newly created synonym SKU_TYPE and how to assign the synonym to the SKU column in table PRODUCT.

As you can see, this way you can create synonyms for external tables, views, functions… and also external types that can be assigned to table columns as data types.
Final database design for Oracle Database:

Generated SQL Script and Custom Code
To view the generated SQL script, either navigate to the Script tab in the right side panel or double click the synonym and click the Script tab.
In section Script preview you can see the generated SQL (1). You can also specify custom code (2) for the synonym and include it in the generated code for your project.

#