Packages, as well as Types can be created in Luna Modeler as other objects and displayed as simple graphical representatives with custom colors. One single object contains basic properties as well as:
- PACKAGE SPECIFICATION and
- PACKAGE BODY
Creating Oracle Database Packages
To add a new type, click Other on the main toolbar and select Package from the drop-down.

Then click the diagram area to place a new graphical representative to the desired position.
In the right-side panel, on tab Details you can specify the Name and the Description for the Package. If you enable displaying descriptions in the diagram settings, the description will be displayed below the package graphics in your ERD.

Click the Script tab and define the code for PACKAGE SPECIFICATION and PACKAGE BODY. If you need a larger area for the code definition, double click the graphical object on the diagram to open a modal form.

Other Objects as Complementary Items
In Luna Modeler, you can also add Other objects to diagrams and include scripts that describe how to how to retrieve records, etc. This feature adds additional value to your diagrams and can help you better document how you work with Packages. See the following example:

To add a new Other object, click the Other item on the main toolbar or add a new object using the diagram context menu.

Then specify the name (1) and colors (2) for the other object.

On the Script tab, define Custom code. If you do not want the code to be included in the generated scripts for the entire project, turn off the switch.

This way you can create several other objects. If you want to group them, use Object Areas. These can help you get a better visual representation of the other objects and also make it easier to manipulate objects belonging to a subject area.

Package SPECS and Package BODIES in Luna Modeler
Packages – with package specification and package body – are displayed as single objects on the diagram and in the left side panel with the overview of all objects. See item PRODUCT_PKG.

However, for the generated SQL script, it may be important to change the order of package specification and package body. Therefore, package specifications and package bodies are handled separately in Luna Modeler, and you can manually change the order. See the PRODUCT_PKG item on the following screenshot. It is displayed twice, once as a Package (specification) and once as a Package body.

#