Documentation

No results
    gitHub

    Entity boxes in ER diagram

    In Hackolade Studio, we use the generic name of "entity" to designate objects for which data is collected or transmitted.  In physical data models, this entity bears a different name depending on the target technology: table in relational and analytics databases, collection in document database (MongoDB, Couchbase, DocumentDB, etc...), node in graph database, record in Avro, message in Parquet and Protobuf, request and response in REST APIs and GraphQL, class in RDF triple stores, etc...

    Create an entity

    In Hackolade Studio, there are many ways to add an entity to the central pane canvas:

    - menu : Action > Add Entity (added at default location)

    - keyboard shortcut (Ctrl/Cmd+L): added at location of mouse cursor

    - toolbar: Add Entity icon: added at location of mouse cursor

    - Diagram Object pane: Add entity via click (added to default location), or via drag-and-drop to the location of your choice

    - Object Browser pane: right-click on container name and use contextual menu (added at default location)

    - Central pane: right-click on model name and use contextual menu (added at default location)

     

     

    - via the Actions menu:

    Menu - Actions - Add Collection

    - by pressing the shortcut Ctrl/Cmd+L

    - with a click of the toolbar icon Icons - addCollection 

    - or with a right-click anywhere in the central pane 

    ER Diagram - contextual menu - add collection

    and choose 'Add Collection'.  

     

    You can proceed to fill collection properties and create fields.

     

    The usual edit actions are possible on an existing collection: cut, copy, paste, duplicate, delete.

     

    To move a collection in the ER diagram, hover the mouse to the collection title so the mouse cursor becomes a move cross:

    ER Diagram - move collection

    then click and hold your left mouse button, then drag the collection where you'd like to place it.  If relationships are attached, they follow the collection and reposition themselves dynamically.

     

    The name bar of a collection is blue, unless changed in the Options tab.  When you select a collection by clicking on the name bar, the related properties pane gets displayed in the Properties Pane on the right.  The collection window can be resized so the content fits in.

     

    ER Diagram - full size collection box

     

    Otherwise, vertical and/or horizontal scroll bars appear:

    ER Diagram - reduced size collection box

     

    The collection window position and size are saved with the model, so they can be retrieved next time it is consulted.

     

    To open a new tab with the hierarchical schema view of a collection, you double-click on the collection name bar, or right-click then choose Open in new tab, or by clicking on the icon

    ERD - open in a new tab

     

     

    A couple of drag-and-drop operations are possible in the ERD:

    - using the handle on the left of each attribute:

    ERD - attribute drag-and-drop

    you may move an attribute up or down within an entity, or to another entity, provided that there are no conflicts.  It is not possible to move attributes across different views.  By pressing the ctrl key, it is possible to perform a copy operation.

    - using the attribute name, to create a relationship.

     

    Several of the controls available in the hierarchical schema view are also available from the ERD view and the Object Browser.

     

    Visual indicators

    The ERD entity boxes have been enriched with visual indicators.  Here is a list of abbreviations:

    pk: primary key

    fk: foreign key

    uk: unique key

    fm: foreign master

    dk: destination or denormalized key (parent of a foreign key.)  Marks keys that are the parent of a foreign key or are denormalized elsewhere in the model.

    dm: destination or denormalized master (parent of a foreign master.)  Marks non-key attributes that are the parent of a foreign attribute or are denormalized elsewhere in the model.  

    PK: partition key, where applicable

    CK: clustering key, where applicable

    sk: sort key, where applicable

    *: required attribute

    +: only in Avro: null allowed

    Ix,y: indexed attribute, with x= index number, y= attribute number in a composite index

     

    Both dk and dm attributes allow access to the Where-Used function in the contextual menu to find all the places in the model where they are denormalized.

     

    You may arrange and align entity boxes in the ERD using the menu option Edit > Align, or the arrange toolbar buttons:

    ERD arrange entities toolbar button  Options include: align left, align center, align right, align top, align middle, align bottom, distribute horizontally, distribute vertically, distribute orthogonally.

     

     

    Display options

    There are different ways to customize your ERD: with the Options tab in the properties pane, you may change the color and font style.  You maybe also modify the sizing behavior when adding or removing attributes, if you do not want the box to automatically adjust.

    ERD display options tab-font style and color

     

    You may also change the display of the ERD and ERDVs.  Each ERD and ERDV persists in the model file its own set of Display Options (except business vs technical name display which is controlled by Naming Conventions for the model target), which may be helpful for data model storytelling.  

     

    Display Options are accessible from 3 different places:

    1) from the Display Options button in the toolbar

     

    ERD display options toolbar

     

    2) from the View > Display Options menu:

    ERD display options view menu

     

     

    3) from Tools > Options > Display > ERD(V):

    Image

     

    These 3 methods are of course connected to each other, and making a change in one place gets dynamically reflected in the other methods.

     

    Some display options are multiple choices, while others simple toggles, and others are mutually exclusive.

     

    Mutually exclusive display options:

    - business names versus technical names: this option affects, non only the ERD and ERDVs, but also the Object Browser (including the OB search) and the schema tree view.  Note that this choice, contrary to the other ones below, is specific to each target for which Naming Conventions have been enabled through through Tools > Options > Naming Conventions

    - entity box content with attributes, description, or empty: by default, ERDs list attributes for entities, but it is also possible to replace the attributes by the entity description.  Or to just display the box without any content, for a more conceptual view of the ERD.

     

    Toggles:

    - diagram objects: you may toggle the display of deactivated modeling objects (containers, entities, attributes, views, relationships), as well as symbols (annotations and rectangles) and database views if applicable to the target [default = enabled]

    - drag-and-drop handles to move attributes within an entity or from one entity to another, or to hide the handle for a more aesthetic and clean look [default = enabled]

    - data types: allows to hide data types for attributes, for a more conceptual/logical view of the ERD [default = enabled]

    - primary key(s) at top: if you don't like for PKs to be automatically moved to the top of the attribute list for an entity, regardless of where in the list they were originally created, you may toggle this option so the attribute (and the DDL schema output) retains its original position in the list [default = enabled]

    - relationship names [default = disabled]

    - "foreign master" relationships (when denormalization has taken place) [default = enabled]

     

    Multiple choices: by default all of the attributes below are displayed.  But you may one to only show some while excluding the others.

    - primary keys

    - foreign keys

    - unique keys

    - required attributes, also known as Not NULL, or mandatory

     

    Diagram Views

    Description of this feature, to create subsets of the main diagram in separate views, has now been moved here.