<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/tg/onlinemanual/em000860" xml:lang="en">
   <Header>
      <Title>Introduction to Entity Relationship Modeling</Title>
      <Keyword type="header" order="d1e1962157">
         <Level1>Introduction</Level1>
         <Level2>Entity Relationship Modeling</Level2>
      </Keyword>
      <Keyword type="header" order="d1e1962162">
         <Level1>Entity Relationship Modeling</Level1>
         <Level2>introduction</Level2>
      </Keyword>
   </Header>
   <GeneralSection>
      <Paragraph>Entity Relationship Modeling gives an insight to the LN application
		databases and the way in which they are interrelated.</Paragraph>
      <List>
         <ListIntro>Entity Relationship Modeling is composed of two main building
		  blocks:</ListIntro>
         <ListItem>Entity types</ListItem>
         <ListItem>Entity relationships</ListItem>
      </List>
      <Paragraph>These building blocks are interrelated and used in entity
		relationship diagrams to show the relationships between the permanent storage
		components. Together with the other components listed below, they let you
		illustrate the diversity of relationships between the different databases. A
		group of related diagrams make up an entity relationship model.</Paragraph>
      <List>
         <ListItemHead>Entity type</ListItemHead>
         <ListItem>A person, place, thing, or concept that you want to record
		  information about. An entity type is a group of entities with common attributes
		  and can be part of a diagram, such as <Code>Trucks</Code>.</ListItem>
         <ListItemHead>Entity</ListItemHead>
         <ListItem>A single occurrence of an entity type; a fact relevant to the
		  company, and about which information is permanently stored. For example: <Code>Truck-A</Code> and <Code>Truck-B</Code>.</ListItem>
      </List>
      <List>
         <ListIntro>Three kinds of entities exist:</ListIntro>
         <ListItemHead>Logical entity</ListItemHead>
         <ListItem>Entities that have a meaning to the real world and are
		  comprised of one or more physical entities; they are defined on a higher
		  abstraction level.</ListItem>
         <ListItemHead>Physical entity</ListItemHead>
         <ListItem>Database tables of the LN application.</ListItem>
         <ListItemHead>Associative entity</ListItemHead>
         <ListItem>An entity used to link other entities. An associative entity
		  type is only used when there is a many-to-many relationship between two entity
		  types.</ListItem>
      </List>
      <ExampleSection>
         <SectionTitle>Example</SectionTitle>
         <Paragraph>There could be an M:N relationship between <Code>EMPLOYEE</Code> and <Code>TRUCK</Code> regarding maintenance.</Paragraph>
         <Paragraph>This relationship does not show which <Code>EMPLOYEE</Code> maintains which <Code>TRUCK</Code>.</Paragraph>
         <Paragraph>There are also other attributes to be considered, such as time
		  spent, part no. and so on.</Paragraph>
         <Paragraph>As a result of the ambiguity regarding the Many-to-many
		  relationship, the associative entity type <Code>MAINTENANCE</Code> can be defined. (See figure 2).</Paragraph>
      </ExampleSection>
      <Figure space-and-orientation="indented-estimated">
         <HTML:IMG xmlns:HTML="http://www.w3.org/TR/REC-html40" width="852" height="582"
                   SRC="../images/tr_graph_dem_aet.png"
                   alt="[...]"/>
         <FigCaption>Associative entity type</FigCaption>
      </Figure>
      <List>
         <ListItemHead>Attribute</ListItemHead>
         <ListItem>A fact or non-decomposable piece of information describing an
		  entity type; for example, Number of wheels.</ListItem>
         <ListItemHead>Attribute value</ListItemHead>
         <ListItem>The value of an attribute; for example, 4 wheels.</ListItem>
         <ListItemHead>Relationship</ListItemHead>
         <ListItem>A reason of relevance for associating entities of one or two
		  entity types.</ListItem>
         <ListItemHead>Cardinality</ListItemHead>
         <ListItem>A specification of the number of possible entities for each
		  entity type of a pairing.</ListItem>
      </List>
      <List>
         <ListIntro>The three types of cardinality are as follows:</ListIntro>
         <ListItemHead>One-to-One (1:1)</ListItemHead>
         <ListItem>A one-to-one relationship. Only one instance of entity type B
		  can be associated with only one instance of entity type A.</ListItem>
         <ListItemHead>One-to-Many (1:N)</ListItemHead>
         <ListItem>A one-to-many relationship. Multiple instances of entity type
		  B can be associated with only one instance of entity type A.</ListItem>
         <ListItemHead>Many-to-Many (M:N)</ListItemHead>
         <ListItem>A many-to-many relationship. Multiple instances of entity type
		  B can be associated with multiple instances of entity type A and
		  vice-versa.</ListItem>
      </List>
      <Paragraph>Within Entity Relationship Modeling, there is no real difference
		between logical and physical entities.</Paragraph>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>The Entity Relationship Modeling procedure</SectionTitle>
      <List>
         <ListIntro>There are two different approaches for modeling
		  databases:</ListIntro>
         <ListItem>The first is the top down approach, which has to be used when
		  physical entity types, entity relationships and entity relationship diagrams
		  have not yet been created. Therefore, you have to manually create and define
		  all entity types and relationships.</ListItem>
         <ListItem>The second is reverse engineering, which is a quick way to
		  model entity relationship diagrams because you can select existing
		  database/table definitions for which a diagram will be created automatically.
		  Reverse engineering can only be used in the case of LN.</ListItem>
      </List>
      <Paragraph>Carrying out the Entity Relationship Modeling procedure results
		in a model that shows the relations between different databases.</Paragraph>
      <Paragraph>Figure 14.2 shows the steps in the Entity Relationship Modeling
		top down procedure.</Paragraph>
      <Figure space-and-orientation="indented-estimated">
         <HTML:IMG xmlns:HTML="http://www.w3.org/TR/REC-html40" width="209" height="450"
                   SRC="../images/tr_graph_dem_erm_td_p.png"
                   alt="[...]"/>
         <FigCaption>The Entity Relationship Modeling top-down
		  procedure</FigCaption>
      </Figure>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>Entity Types (tgerm2500m000)</SectionTitle>
      <Paragraph>To create the entity types, use the <GUIRef href="/baanerp/tg/erm/tgerm2500m000" role="session">Entity Types (tgerm2500m000)</GUIRef>.</Paragraph>
      <List>
         <ListIntro>To define an entity type, complete the following
		  steps:</ListIntro>
         <ListItem>In the <GUIRef href="/baanerp/tg/erm/tgerm2500m000" role="session">Entity Types (tgerm2500m000)</GUIRef> session, click <Emphasis>New</Emphasis>
         </ListItem>
         <ListItem>In the <GUIRef href="/baanerp/tg/erm/tgerm2500m000#tgerm200.entt" role="manual">Entity Type</GUIRef> field, specify an id for the entity
		  type.</ListItem>
         <ListItem>Click <GUIRef href="/baanerp/tg/brg/tgbrg1110s000#exec.user.0" role="manual">Save</GUIRef>
         </ListItem>
      </List>
      <TABLE width="100%" border="1" space-and-orientation="indented-custom"
             borderstyle="default">
         <THEAD noTR="1">
            <TR no="1" isLast="true">
               <TD colspan="2" rowspan="1">Key fields for the <GUIRef href="/baanerp/tg/erm/tgerm2100s000" role="session">Entity Type Details (tgerm2100s000)</GUIRef> session</TD>
            </TR>
         </THEAD>
         <TBODY noTR="6">
            <TR no="1" isLast="false">
               <TH rowspan="1" colspan="1">Field</TH>
               <TH rowspan="1" colspan="1">Description</TH>
            </TR>
            <TR no="2" isLast="false">
               <TD rowspan="1" colspan="1">
                  <GUIRef href="/baanerp/tg/erm/tgerm2100s000#tgerm200.cpac" role="manual">Owner Package</GUIRef>
               </TD>
               <TD rowspan="1" colspan="1">The package to which the entity type is related.</TD>
            </TR>
            <TR no="3" isLast="false">
               <TD rowspan="1" colspan="1">
                  <GUIRef href="/baanerp/tg/erm/tgerm2100s000#tgerm200.cmod" role="manual">Owner Module</GUIRef>
               </TD>
               <TD rowspan="1" colspan="1">The module to which the entity type is related.</TD>
            </TR>
            <TR no="4" isLast="false">
               <TD rowspan="1" colspan="1">
                  <GUIRef href="/baanerp/tg/erm/tgerm2100s000#tgerm200.nent" role="manual">Link to Diagram</GUIRef>
               </TD>
               <TD rowspan="1" colspan="1">The entity-relationship diagram into which an entity type is
				decomposed. At a different level in the DEM-Tool, you can see the entity-type
				relationship between the current entity type and other entity types.</TD>
            </TR>
            <TR no="5" isLast="false">
               <TD rowspan="1" colspan="1">
                  <GUIRef href="/baanerp/tg/erm/tgerm2100s000#tgerm200.ectg" role="manual">Entity Type Category</GUIRef>
               </TD>
               <TD rowspan="1" colspan="1">If you select this check box, the entity type is a physical
				entity type or a logical entity type related to the Baan package.</TD>
            </TR>
            <TR no="6" isLast="true">
               <TD rowspan="1" colspan="1">
                  <GUIRef href="/baanerp/tg/erm/tgerm2100s000#tgerm200.sstv" role="manual">Associative Entity Type</GUIRef>
               </TD>
               <TD rowspan="1" colspan="1">If you select this check box, the entity type serves as a link
				between two other entity types that have a many-to-many relationship between
				them.</TD>
            </TR>
         </TBODY>
      </TABLE>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>Tables by Entity Type (tgerm4100m000)</SectionTitle>
      <Paragraph>To select one or more tables from the <GUIRef href="/baanerp/tt/adv/ttadv4526m000" role="session">Table Definitions (ttadv4526m000)</GUIRef> session, and to link those tables to the selected
		entity type, use the <GUIRef href="/baanerp/tg/erm/tgerm4100m000" role="session">Tables by Entity Type (tgerm4100m000)</GUIRef> session.</Paragraph>
      <List>
         <ListIntro>To start this session:</ListIntro>
         <ListItem>On the <Link href="/baanerp/tc/glossary/glossary#specific" role="glossary">appropriate</Link> menu of the <GUIRef href="/baanerp/tg/erm/tgerm2500m000" role="session">Entity Types (tgerm2500m000)</GUIRef> session, click <GUIRef href="/baanerp/tg/erm/tgerm2500m000#exec.user.0" role="manual">Link ERP Tables to Entity Type...</GUIRef>
         </ListItem>
      </List>
      <Paragraph>One entity type can be linked to several tables. The
		interdependent relations between these tables are shown at different levels in
		the Modeler.</Paragraph>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>Entity Type Relationships (tgerm3500m000)</SectionTitle>
      <Paragraph>To list and define entity type relationships, use the <GUIRef href="/baanerp/tg/erm/tgerm3500m000" role="session">Entity Type Relationships (tgerm3500m000)</GUIRef> session. The relationships listed in the <GUIRef href="/baanerp/tg/erm/tgerm3500m000" role="session">Entity Type Relationships (tgerm3500m000)</GUIRef> session have been established between
		the entity types listed in the <GUIRef href="/baanerp/tg/erm/tgerm2500m000" role="session">Entity Types (tgerm2500m000)</GUIRef> session.</Paragraph>
      <Paragraph>To define entity type relationships, in the <GUIRef href="/baanerp/tg/erm/tgerm3100s000" role="session">Entity Type Relationship Details (tgerm3100s000)</GUIRef> session, select the entity types
		between which relationships are to be established. You can also define the
		cardinality of the relationship between the selected entity types.</Paragraph>
      <Paragraph>In the case of an M:N relationship, an associative entity type
		can be created, and a table can be selected from the <GUIRef href="/baanerp/tt/adv/ttadv4526m000" role="session">Table Definitions (ttadv4526m000)</GUIRef> session to serve as a link between two entity
		types.</Paragraph>
      <List>
         <ListIntro>To define a relationship between two entity types, complete
		  the following steps:</ListIntro>
         <ListItem>In the <GUIRef href="/baanerp/tg/erm/tgerm3100s000#tgerm300.rltn" role="manual">Data Entity Relationship</GUIRef> field, specify an ID for the
		  relationship.</ListItem>
         <ListItem>In the <GUIRef href="/baanerp/tg/erm/tgerm3500m000#tgerm300.fnnt" role="manual">From Entity Type</GUIRef> field, select the first entity type
		  involved in the relationship.</ListItem>
         <ListItem>In the <GUIRef href="/baanerp/tg/erm/tgerm3500m000#tgerm300.tnnt" role="manual">To Entity Type</GUIRef> field, select the other entity type involved in the
		  relationship.</ListItem>
         <ListItem>In the <GUIRef href="/baanerp/tg/erm/tgerm3100s000#tgerm300.mcfr" role="manual">Min Cardinality From - To</GUIRef> field, specify the number of possible entities
		  for each entity type of a pairing for the entity type you selected in the <GUIRef href="/baanerp/tg/erm/tgerm3500m000#tgerm300.fnnt" role="manual">From Entity Type</GUIRef> field.</ListItem>
         <ListItem>In the <GUIRef href="/baanerp/tg/erm/tgerm3100s000#tgerm300.mcto" role="manual">Min Cardinality To - From</GUIRef> field, for the entity type you have selected in
		  the <GUIRef href="/baanerp/tg/erm/tgerm3500m000#tgerm300.tnnt" role="manual">To Entity Type</GUIRef> field, specify the number of possible
		  entities per entity type of a pairing.</ListItem>
         <ListItem>Click <GUIRef href="/baanerp/tg/brg/tgbrg1110s000#exec.user.0" role="manual">Save</GUIRef>
         </ListItem>
      </List>
      <TABLE width="100%" border="1" space-and-orientation="indented-custom"
             borderstyle="default">
         <THEAD noTR="1">
            <TR no="1" isLast="true">
               <TD colspan="2" width="1022" rowspan="1">Key fields for the <GUIRef href="/baanerp/tg/erm/tgerm3100s000" role="session">Entity Type Relationship Details (tgerm3100s000)</GUIRef> session</TD>
            </TR>
         </THEAD>
         <TBODY noTR="5">
            <TR no="1" isLast="false">
               <TH width="240" rowspan="1" colspan="1">Field</TH>
               <TH width="778" rowspan="1" colspan="1">Description</TH>
            </TR>
            <TR no="2" isLast="false">
               <TD width="240" rowspan="1" colspan="1">
                  <GUIRef href="/baanerp/tg/erm/tgerm3100s000#tgerm300.rlst" role="manual">Relationship is Subtype</GUIRef>
               </TD>
               <TD width="778" rowspan="1" colspan="1">If this check box is selected,, the entity-type
				relationship is between a subtype and a supertype entity type; it is used to
				indicate that the supertype’s attribute also applies to the subtype.</TD>
            </TR>
            <TR no="3" isLast="false">
               <TD width="240" rowspan="1" colspan="1">
                  <GUIRef href="/baanerp/tg/erm/tgerm3100s000#tgerm300.pdrl" role="manual">Physical Database Relation exists</GUIRef>
               </TD>
               <TD width="778" rowspan="1" colspan="1">If this check box is selected,, the entity-type
				relationship is between entity types that have tables from the LN data dictionary
				linked to them.</TD>
            </TR>
            <TR no="4" isLast="false">
               <TD width="240" rowspan="1" colspan="1">
                  <GUIRef href="/baanerp/tg/erm/tgerm3100s000#tgerm300.sstb" role="manual">Associative Table</GUIRef>
               </TD>
               <TD width="778" rowspan="1" colspan="1">An LN table used to link two entity types that have a many to many
				relationship between them</TD>
            </TR>
            <TR no="5" isLast="true">
               <TD width="240" rowspan="1" colspan="1">
                  <GUIRef href="/baanerp/tg/erm/tgerm3100s000#tgerm300.mxnf" role="manual">Infinite</GUIRef>
               </TD>
               <TD width="778" rowspan="1" colspan="1">If this check box is selected,, the maximum to-from
				relationship is infinite.</TD>
            </TR>
         </TBODY>
      </TABLE>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>Entity Relationship Diagrams (tgerm1500m000)</SectionTitle>
      <Paragraph>To create and maintain the entity-relationship diagrams, use the <GUIRef href="/baanerp/tg/erm/tgerm1500m000" role="session">Entity Relationship Diagrams (tgerm1500m000)</GUIRef> session. An entity-relationship diagram is a
		graphical design of the relational data model structure. The diagram shows a
		multilevel structure that consists of entity types and entity-type
		relationships.</Paragraph>
      <List>
         <ListIntro>To create an entity-type relationship diagram, complete the
		  following steps:</ListIntro>
         <ListItem>In the <GUIRef href="/baanerp/tg/erm/tgerm1500m000#tgerm100.erid" role="manual">Entity Rel. Diagram</GUIRef> field, specify an ID for the
		  entity relationship diagram.</ListItem>
         <ListItem>In the <GUIRef href="/baanerp/tg/erm/tgerm1100s000#tgerm100.user" role="manual">Owner</GUIRef> field, select the LN user who created or
		  is responsible for the entity relationship diagram.</ListItem>
         <ListItem>Select who is authorized to modify the diagram by selecting one
		  of the check boxes under <GUIRef href="/baanerp/tg/brg/tgbrg3165s000#tggen.modify.by" role="groupbox">To be modified by</GUIRef>.</ListItem>
         <ListItem>Click <GUIRef href="/baanerp/tg/brg/tgbrg1110s000#exec.user.0" role="manual">Save</GUIRef>
         </ListItem>
      </List>
   </GeneralSection>
</ManualTopic>