Forum Stats

  • 3,783,413 Users
  • 2,254,769 Discussions
  • 7,880,385 Comments

Discussions

Unarn relationship in Data Modeler

Hi

I have a basic question. How to model a unarn relationship as below:

Each employee has its own manager. Is this possible in a logical model?

Regards

Ziut

Best Answers

Answers

  • Ziut
    Ziut Member Posts: 363 Bronze Badge

    Thank you Dave for your reply.

    It confirmed my belief that there is no need to report the ID MANAGER attribute in the logical model. Below is my solution, which differs in that not every employee needs to have a manager (for example, a CEO).

    I have another problem in the field of modelling. Let's say I have two entities: CLIENT and PRODUCT, and a many-to-many relationship between them. For example, a customer purchases two computers, three drives, and one monitor and receives one invoice.


    How do I show that it's a multi-position invoice, not a single-position invoice? Is it possible? So far, I have to use two more INVOICE HEADER and INVOICE DETAILS entities. Question: Do I need to create an INVOICE entity or two INVOICE HEADER and INVOICE DETAILS entities or not?

    Do you have another way?

    Yours and a successful New Year (without COVID!!!).

    Ziut

  • Philip Stoyanov-Oracle
    Philip Stoyanov-Oracle Member Posts: 3,370 Employee
    edited Jan 4, 2021 8:35AM

    Hello Ziut,

    Let's say I have two entities: CLIENT and PRODUCT, and a many-to-many relationship between them. For example, a customer purchases two computers, three drives, and one monitor and receives one invoice.

    In this case is better to use what @Dave Schleis suggested.

    Otherwise you also can have attributes at relationship:

    and they will appear in intersection table :


    Philip

  • Ziut
    Ziut Member Posts: 363 Bronze Badge

    Hello Philip,

    Happy New Year!!!

    As for your solution. It is well known to me and I use it. But your example is not good, because in the created table Relation_1 the invoice_header and _details do not correspond to reality. What do they mean?

     I am looking for the best way to present the CLIENT – INVOICE – PRODUCT model at the logical level. But INVOICE is header (order date, client, total sum) and details ( {product, price and quantity} -many times).

    As of today, we use (Dave and I and ...) this solution is four entities and four tables.


    But by the way, Philip, enlighten me how to fix the property settings in Data Modeler so that they apply to all new projects.

    I mean:


    I use as Foreign Key: {parent}_FK and as Column Foreign Key: {ref_column}.

    How to set it permanently in DM?

    Regards

    Ziut

  • Ziut
    Ziut Member Posts: 363 Bronze Badge

    Thank you Philip,

     I could not find the "system data_types" directory, but I coped. Inside the DM software is  folder “types” and  file dl_settings.xml. You can change it manually or use the function you described.

    By the way, I would like to recall my post:

    https://community.oracle.com/tech/developers/discussion/4306750/function-and-trigger-templates-in-dm-19#latest

    Point to where you can change these patterns (function and trigger).

    Regards

    Ziut

  • Ziut
    Ziut Member Posts: 363 Bronze Badge

    Philip,

    Thank you for your explanation. And will you help with the second issue of function and trigger templates? Is this a problem?

    Ziut