DM3.0 EA2: Logical Model Relation Cardinality:Source Optional mislabeled?

In logical model, created a 1:N non-identifying relation between 2 entities - Parent and Child. Parent is 1:N with Child. Both entities have a single column primary key - parent_id and child_id respectively. I would like to enforce RI such that a parent may exist with no children, but a child may not exist without a parent.
In the logical model the relation properties, cardinality - I modify the Source Optional and Target Optional checkboxes to achieve my desired result. I first tried checking Target Optional and leaving Source Optional un-checked. I then engineer a physical model and generate DDL for Oracle 11g I get this constraint:
SQL>ALTER TABLE child
  2      ADD CONSTRAINT Relation_1 FOREIGN KEY
  3      (
  4       parent_id
  5      )
  6      REFERENCES parent
  7      (
  8       parent_id
  9      )
10      ON DELETE SET NULL
11  ;
Table altered.Here's a test case illustrating this isn't quite what I wanted (starting with both tables empty):
SQL>
SQL>
SQL>insert into parent (parent_id) values (1);
1 row created.
SQL>commit;
Commit complete.
SQL>
SQL>insert into child (child_id, parent_id) values (901, 1);
1 row created.
SQL>commit;
Commit complete.
SQL>
SQL>delete from parent;
delete from parent
ERROR at line 1:
ORA-01407: cannot update ("ODS_ETL_OWNER"."CHILD"."PARENT_ID") to NULLIf I have Source Optional checked, and Target Optional not checked, engineer a physical model and generate DDL for Oracle 11g I get this constraint which produces the desired results with my test case:
SQL>ALTER TABLE child
  2      ADD CONSTRAINT Relation_1 FOREIGN KEY
  3      (
  4       parent_id
  5      )
  6      REFERENCES parent
  7      (
  8       parent_id
  9      )
10  ;
Table altered.
SQL>
SQL>insert into parent (parent_id) values (1);
1 row created.
SQL>commit;
Commit complete.
SQL>
SQL>insert into child (child_id, parent_id) values (901, 1);
1 row created.
SQL>commit;
Commit complete.
SQL>
SQL>delete from parent;
delete from parent
ERROR at line 1:
ORA-02292: integrity constraint (ODS_ETL_OWNER.RELATION_1) violated - child
record foundBut that seems backwards - and the documentation also reads as if it’s backwards. Am I missing something or are the Source Optional and Target Optional checkboxes mislabeled? Should they be Source Manditory and Target Manditory?

I would like to enforce RI such that a parent may exist with no children, but a child may not exist without a parent.You need to set parent as optional and child to be mandatory.
Am I missing something or are the Source Optional and Target Optional checkboxes mislabeled? Should they be Source Manditory and Target Manditory?There is a relationship and two ends of that relationship and you can set for each end whether it's optional or not. And that's seen directly using Barker notations. Source and target optionality place will be swapped on diagram if you use IE notation.
I expected that cardinality part could be more confusing for you because at source end you define cardinality of the target, but it seems you have no problem with that.
Philip

Similar Messages

  • Delete rule from logical to relational model

    hello!
    I use data modeler Version 3.1.0.700 and I have some problems with delete rule.
    I have set delete rule in logical model on every relation (NO ACTION) but when i engineer it to relational there is everything randomized.
    How do i change this to be as it is in logical model?
    Thank you for your answer in advance!
    Grega

    as I explained in previous post "delete rule"in logical model is used in only one case:
    the setting in logical model is used only when relationship will be transformed into optional foreign key with non mandatory FK columns.Settings in compare/copy options" tab are used to exclude some properties from compare and engineer process.
    Philip

  • How to show relation attribute on logical model

    Hi.
    How to show child entity relation attributes on logical model?
    Entity properties attribute list contains relation attributes, LM dont show they.
    I have model with several subviews. I need to show some entity without related entities but need to save "semantic" of relations on this subview. When relation attributes does not visible - no information about invisible relations on this subview.
    I can create my own visible attribute like "reference to customer" to make sense the relation with entity "Customer". This case problem is relation attribute presents in entity implicitly and relation model have 2 attribute - my own and generated FK column.
    In logical model i can`t replace child table relation attribute to my own "visible" attribute.
    In relational model i should redefine FK manually. Transformation script is posible but very odd way.
    Any advice appreciated.

    I am confused.
    I think the legacy Oracle Designer Barker notation could show reation attributes optional or by default, int`t it?
    Thanks a lot anyway.

  • Delete Rules between Logical Model and Relational Model are different

    Relation Properties in Logical model has three Delete Rules: "RESTRICT", "NO_ACTION", "SET NULL".
    1. "RESTRICT" and "NO_ACTION" are same
    2. "CASCADE" is missing.
    However, Foreign Key Properties in Physical model has three Delete Rules: "RESTRICT", "NO_ACTION", "CASCADE".
    1. "RESTRICT" and "NO_ACTION" are same
    2. "SET NULL" is missing in this case.
    They are supposed to have "NO_ACTION or RESTRICT", "SET NULL", and "CASCADE".
    Please fix this ASAP. It is really annoying in Engineering process. Modeler creates duplicate wrong relationships while it engineers.
    Thanks.
    Edited by: hayangae on Oct 9, 2012 1:01 PM
    Edited by: hayangae on Apr 3, 2013 4:08 PM

    Hi,
    it seems you are not using the latest version 3.3. In earlier versions - delete rule set on relationship was used only in some cases to set delete rule on related foreign key. Now delete rule is transferred to FK as it's defined on relationship.
    I assume you are using Oracle database - "Restrict" doesn't appear anymore for Oracle.
    2. "SET NULL" is missing in this case.Most likely the foreign key is set as mandatory thus you cannot use "set null" as option.
    Modeler creates duplicate wrong relationships while it engineers.Can you elaborate on that - example?
    Philip

  • DataModeler: Cannot engineer from logical model to relational model

    Hello,
    I have been trying for a couple of (very frustrating) hours to engineer a very simple logical model to its relational model. The toolbar button (and also menu option) that should do this just does nothing. No errors, no feedback, absolutely nothing!!! However I could engineer a relational model back to its logical model.
    I am using SQL Modeler version 1.5.1 build 525 on Windows Vista. I have closed and restarted the program many times but to no avail. Are there other factors (e.g. anti-virus, JDK etc) that could be responsible? But then why are other parts of the software working but not this one?
    Please kindly send your advice asap so I can proceed. I really like the Modeler and will not want to discard it.
    Thanks,
    Chiedu

    Hi Folks,
    I was able to figure out the likely cause of the problem. The version of Modeler (datamodeling-1.5.1-525-no-jre.zip) I used was downloaded without JRE. The current version of JRE installed on my computer is Java 6 Update 12 (build 1.6.0_12-b04). I suppose the two don't quite work very well together.
    I have now downloaded and installed another version (datamodeling-1.5.1-525.zip) with its own JRE and the problem was resolved.
    My guess is that the problem was due to the incompatibilities that may exist between Data Modeler and the various versions of JRE.
    Thanks.

  • Column Prefix from Logical to Relational Model

    Hi,
    is there any option, that data modeler append an prefix (table short name) to a column, when the logical model will be transformed to relational model? (Same behavior as Oracle Designer)
    Example:
    Logical Model
    TABLE: PERSON
    TABLE-SHORT: PERS
    COLUMN-1: ID
    COLUMN-1: NAME
    Relational-Model
    TABLE: PERSON
    COLUMN-1: PERS_ID
    COLUMN-2: PERS_NAME
    Kind Regards,
    Stefan

    Thanks for your answer!
    This Script is not really working for me, because of our foreign keys.
    All our Foreign-Keys are named "ID" (for nummeric column) or "INDEX" (for a varchar column). After the transformation form logical to relational all the foreign-keys are named like "ID1", "ID2", "ID3", "INDEX1", "INDEX2" etc.
    There is no way to apply this script before the foreign-keys where added in the tables?
    The Second Way is to create a new script for this task.
    am i the only one with this problem? :-/

  • How to copy field comments from logical model to relational one?

    Dear gurus!
    I had a logical model without field comments. Then I made an engineering of logical model into relational one. Later I added field comments to logical model. How can I copy these values to relational model? Seems to me that when I use
    model.getTableSet().toArray()
    then I get list of relational model tables. How can I get a list of logical "tables" and to get a relations between those two lists?
    Thank you!
    Edited by: user12947051 on 12.01.2012 23:58
    Edited by: user12947051 on 12.01.2012 23:58

    You don't need to write and run script for that. Just use engineering to relational model. Use compare/copy options tab if you don't want something else to go into relational model
    Philip

  • Data Model: Relational Tables/Columns Naming Options

    Hello,
    My design consists of several Relational models.
    1. Using Logical model properties, I defined Naming Options (Max. Name Length, Character Case, Valid Characters) applicable to all Entities, Attributes and Views.
    2. But for Relational models, Tables/Columns/Views Naming Options (Max. Name Length, Character Case, Valid Characters) can only be defined per Relational model and not for all the models.
    Question: Is it possible to define Tables/Columns/Views Naming Options (Max. Name Length, Character Case, Valid Characters) applicable to all Relational models? If yes, please inform me.
    Thanks
    Chiedu

    Andrey,
    When You select all the columns, you need to hold the Shift key to select all. Don't let it go to do the copy. So, still holding the shift key, right click for the context menu. The menu only has 2 items, Copy and Delete. Now Copy. Then you can go to the diagram and select paste, to paste them in each of the tables you want those columns to appear in.
    Sue

  • Logical model fwd engineer to relational model.  Missing FK relationships

    We are experiencing missing relationships in the relational model when engineering from logical model to the relational model. The logical model objects have properly defined primary keys defined. We are using SQL Data Modeler v3.1.700. Any suggestions on how to engineering these relationships without deleting the objects from the relational model.
    Thanks,
    Ed

    Hi Ed,
    I presume you had some relationships in the Logical Model that you were expecting to be engineered to Foreign Key relationships in the Relational Model.
    Please can you provide more detail to help resolve your problem. For example:
    Was the problem on an initial engineer from the logical model? Or on a re-engineer?
    Are you using Entity subtyping in your Logical Model?
    Are there any relevant error messages in the log file? (This is normally file datamodeler.log in folder datamodeler\datamodeler\log.)
    David

  • Define fields names in relation at logical model

    Hi all,
    Image
    On a Logical Model, I have 2 entitys, Events and Menu, and has 2 relations.
    When Engineer to Relational, creates 2 new fields in my Events Table, Menu_ID, Menu_ID1. There are some way, in the relation at logical model, to specify the names of the final fields, to avoid to change it later at relational model?
    Regards.

    Hi,
    you can look here Role Naming Foreign Key columns
    Philip

  • Export logical model open all relational and physical model? -- Problem

    Hello,
    If I export only logical model ( file --> export --> To design Data Modeler) . Oracle Data Modeler open all relational and physical model, if I have 100 relational model open all, and this is very resource.
    Can it be avoided?
    Thanks.

    Ok, thanks
    This bug Will solved for version final Data Modeler 4.1 ?

  • Engineering from relational model to logical model duplicated views

    Hi all,
    Several times, also in different projects, when I engineer from relational model to the logical model, the comparator tool show me de differences.
    In these differences there are no view differences, but when I finish the process everything goes right except that in the logical model under views, I see all the views duplicated with [view_name]v1.
    I've tried not selecting the view checkbox, in the compare dialog,but I get duplicated views also.
    I don't know fir sue if this happens with table also.
    What can I do to solve this problem? Is this a bug?
    Edited by: morfeo8marc on 04-abr-2012 2:02

    The problem is fixed in DM 3.1.1.703 and it's published. You can run following script and save design in order to get mappings for views recovered.
    Philip
    lmodel = model.getDesign().getLogicalDesign();
    rmodels = model.getDesign().getRelationalDesigns().toArray();
    for (var i = 0; i < rmodels.length; i++) {
    rm = rmodels;
    eviews = lmodel.getEntityViewSet().toArray();
    for (var k = 0; k < eviews.length; k++) {
    ev = eviews[k];
    tv = rm.getTableViewSet().getObjectByID(ev.getGeneratorID());
    if(tv == null){
    tv = rm.getTableViewSet().getObjectGeneratedBy(ev);
    if(tv != null){
    rm.getRMExtendedMap().createMapping(ev,tv);

  • Engineer between Logical Model and Relational Model

    I am trying to update changes from one model to the other but there are dublicate entries generated instead of updates.
    The Logical Model was imported from Oracle Designer, the Relational Model was imported from data dictionary.
    Our rule is, that the name of Entities/Tables and Attribute/Columns are identical.
    So I changed the Naming Standard of the Logical Model in Preferences
    from Separator = Space to Separator = Character with char = Underline.
    If the entity is not existing, it is created with the correct name.
    If the entity exists, a new entity is created with Namev1.
    The same happens when I try to update changes in the other direction.
    How can I achieve that the existing entity (or table) is updated and not a new one is created?
    Or in other words, is there a way to link entities to corresponding tables?
    Walter

    Hi Walter,
    The Logical Model was imported from Oracle Designer, the Relational Model was imported from data dictionaryit's good to import entities and related tables from Designer repository together. Data Modeler will import the link between them and use that link in synchronization between logical and relational model. After that you can import details for physical model from database.
    If you don't have tables in Designer repository and keep the same names for entities, attributes, tables and columns then you can engineer logical model to relational and import details from database.
    Philip

  • Engineering to and from logical and relational models

    I have tried to modify a logical model entity by adding an attribute or two, tried to engineer to the associated relational model, only to have the engineering process create a brand new table rather than adding the new column or two to the existing table.
    Creating the column in the table first and engineering back to the logical model didn't appear to do anything, although I might have missed a new logical entity.
    Is this how the product is supposed to work?

    Hello,
    I'm sorry but your steps are not evident for me.How it works - you can start from table or entity, it doesn't matter which one is first you should be able to synchronize changes.
    Let's assume you have two relational models RM1 and RM2 and table TABLE_1 in RM1. if you engineer RM1 to logical model then entity will be created that corresponds to TABLE_1 in RM1 (and it will be named TABLE_1 if you don't use glossary that provides replacement of TABLE with something else).
    You can add attribute to entity and engineer logical model to other relational model (RM2) - new table will be created in RM2.
    Add one more attribute to entity and engineer to RM1 - two attributes will appear showing that two new columns can be created - they are not selected and you have to select them if you want columns to be created.
    You'll get only one new attribute (column) if you engineer to RM2 - the first added attributed is already there as column.
    Of course you can add columns in tables and can synchronize them with entity in logical model.
    Philip

  • How to change "Relation UID" attribute name in logical model?

    Beginner question here, sorry if it has been covered already.
    In the Logical model in Data Modeler, how do I change an attribute name which is used as a "Relation UID"?
    For example, I create two entities each with a Primary UID called "id", then create a 1:1 relationship. Each entity will now have an attribute called "id1" marked as a Relation UID, but I can find no way to change the attribute's name. Is there a way?
    Thanks.

    Hi GuyM,
    you need to check setting in preferences - "Data Modeler>Model>logical" - FK attribute name synchronization - clear the check box if you want to set the name manually.
    Philip

Maybe you are looking for