<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/tg/onlinemanual/em000870" xml:lang="en">
   <Header>
      <Title>The data model in the Modeler</Title>
      <Keyword type="header" order="d1e2284728">
         <Level1>Data model</Level1>
         <Level2>in the Modeler</Level2>
      </Keyword>
      <Keyword type="header" order="d1e2284733">
         <Level1>In the Modeler</Level1>
         <Level2>data model</Level2>
      </Keyword>
   </Header>
   <GeneralSection>
      <Paragraph>Next to the Enterprise Structure Model, the Business Function
		Model, and the Business Process Model, the data model is the fourth type of
		diagram you can model in the Modeler.</Paragraph>
      <Paragraph>When you create or modify an entity relationship diagram, the
		following buttons are available in the Modeler.</Paragraph>
      <List>
         <ListIntro>An entity type represents a cluster of associated data. There
		  are two alternative entity types. To change the entity type, right-click an
		  entity type, point to <Emphasis>Alternative</Emphasis>, and click one of the
		  following two options:</ListIntro>
         <ListItemHead>
            <GUIRef href="/baanerp/tg/domains/brg.wdth#normal" role="option">Normal</GUIRef>
         </ListItemHead>
         <ListItem>The logical data set (table)</ListItem>
         <ListItemHead>
            <GUIRef href="/baanerp/tg/domains/erm.etyp#associative" role="option">Associative Entity Type</GUIRef>
         </ListItemHead>
         <ListItem>This is an entity type used to represent a many-to-many
		  relationship between two entities. Normally, a table is used to create a
		  many-to-many relationship.</ListItem>
      </List>
      <List>
         <ListIntro>To link a ERP Enterprise table to an entity type, complete these steps:</ListIntro>
         <ListItem>Right-click an entity type and point to <GUIRef href="/baanerp/tt/domains/dba.dbpr#dbin" role="option">Insert</GUIRef>
         </ListItem>
         <ListItem>Click <GUIRef href="/baanerp/tt/adv/ttadv4526m000#ttadv420.cmod" role="manual">Table</GUIRef>
         </ListItem>
         <ListItem>In the window that opens, click <GUIRef href="/baanerp/tt/domains/dba.dbpr#dbin" role="option">Insert</GUIRef>
         </ListItem>
         <ListItem>In the <GUIRef href="/baanerp/tt/adv/ttadv4526m000" role="session">Table Definitions (ttadv4526m000)</GUIRef> session, select a ERP Enterprise table.</ListItem>
         <ListItem>Click <GUIRef href="/baanerp/tt/domains/stpycancel#ok" role="option">OK</GUIRef>
         </ListItem>
      </List>
      <List>
         <ListIntro>To link an underlying entity relationship to an entity type,
		  complete these steps:</ListIntro>
         <ListItem>Right-click an entity type and point to <GUIRef href="/baanerp/tt/domains/dba.dbpr#dbin" role="option">Insert</GUIRef>
         </ListItem>
         <ListItem>Click <GUIRef href="/baanerp/tg/erm/tgerm1500m000#exec.user.7" role="manual">Copy ERD to Current Version</GUIRef>
         </ListItem>
         <ListItem>In the <GUIRef href="/baanerp/tg/erm/tgerm1500m000" role="session">Entity Relationship Diagrams (tgerm1500m000)</GUIRef> session, select an entity relationship
		  diagram.</ListItem>
         <ListItem>Click <GUIRef href="/baanerp/tg/domains/brg.inte#ok" role="option">OK</GUIRef>
         </ListItem>
      </List>
      <Paragraph>A relationship defines a relation between two entity
		types.</Paragraph>
      <Paragraph>The cardinality of a relationship defines the expected number of
		related occurrences for each of the two entity types.</Paragraph>
      <List>
         <ListIntro>You can show that one way or both ways of the relationship are
		  optional. To make a relationship optional, complete these steps:</ListIntro>
         <ListItem>Right-click a relationship and point to <GUIRef href="/baanerp/tt/domains/dba.dbpr#dbin" role="option">Insert</GUIRef>.</ListItem>
         <ListItem>Depending on which part of the relationship you want to make
		  optional, click either <Emphasis>Optional From –To</Emphasis> or <Emphasis>Optional To – From</Emphasis>
         </ListItem>
      </List>
      <Paragraph>The subtype relationship is a relationship between a subtype and
		a supertype; it is used to indicate that the attributes of the supertype also
		apply to the subtype.</Paragraph>
      <Paragraph>The following figure shows the relationships between versions,
		entity types, entity type categories, and database tables in the
		Modeler.</Paragraph>
      <Figure space-and-orientation="indented-estimated">
         <HTML:IMG xmlns:HTML="http://www.w3.org/TR/REC-html40" width="579" height="651"
                   SRC="../images/tr_graph_dem_rel_t_et_v_eme.png"
                   alt="[...]"/>
         <FigCaption>The relationship between tables, entity types and versions as
		  shown in the Enterprise Modeler Editor (EME)</FigCaption>
      </Figure>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>Sessions used in the Modeler</SectionTitle>
      <List>
         <ListIntro>The following sessions are only accessible from the
		  Modeler:</ListIntro>
         <ListItemHead>
            <GUIRef href="/baanerp/tg/erm/tgerm1102s000" role="session">Entity Relationship Diagram Properties (tgerm1102s000)</GUIRef>
         </ListItemHead>
         <ListItem>Use this session to view or change the details of an entity
		  relationship diagram.</ListItem>
         <ListItemHead>
            <GUIRef href="/baanerp/tg/erm/tgerm1103s000" role="session">Create Entity Relationship Diagram (tgerm1103s000)</GUIRef>
         </ListItemHead>
         <ListItem>Use this session to define the details of an entity
		  relationship diagram when you create a new diagram from the editor.</ListItem>
         <ListItemHead>
            <GUIRef href="/baanerp/tg/erm/tgerm1130s000" role="session">Entity Types (tgerm1130s000)</GUIRef>
         </ListItemHead>
         <ListItem>Use this session to change entity type details or replace the
		  selected entity type by a new one. In this session, you can also link a child
		  diagram to an entity type by zooming to the <GUIRef href="/baanerp/tg/erm/tgerm1500m000" role="session">Entity Relationship Diagrams (tgerm1500m000)</GUIRef> session.</ListItem>
         <ListItemHead>
            <GUIRef href="/baanerp/tg/erm/tgerm1140s000" role="session">Entity Type Relationships (tgerm1140s000)</GUIRef>
         </ListItemHead>
         <ListItem>Use this session to change entity type relationship details
		  such as cardinality and relationship category. This session also lets you
		  include an associative table in the diagram.</ListItem>
      </List>
      <Paragraph>To modify the fields and indices of the tables linked to an
		entity type, double-click the entity type icon, or right-click an entity type,
		point to <GUIRef href="" role="menu">Edit</GUIRef>, and click <GUIRef href="/baanerp/tg/erm/tgerm1410m000#tables.yn" role="manual">Tables</GUIRef>. To modify the field or index data, in the
		Window that appears, click <GUIRef href="/baanerp/tg/messages/erm25056" role="message">Show Table Fields</GUIRef> icon or <GUIRef href="/baanerp/tg/messages/erm25055" role="message">Show Table Indices</GUIRef>.</Paragraph>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>The reverse-engineering procedure</SectionTitle>
      <Paragraph>Instead of creating entity relationship diagrams from scratch,
		you can use reverse engineering when you create a data model consisting of ERP Enterprise tables.</Paragraph>
      <Paragraph>Reverse engineering lets you use information from an existing
		database. You can either select entity types that have not been used before in
		entity relationship diagrams, or generate a new set of entity types for which
		entity relationships or entity relationship diagrams already exist.</Paragraph>
      <Paragraph>Figure 14.8 shows the two sessions that make up the procedure
		for reverse engineering.</Paragraph>
      <Figure space-and-orientation="indented-estimated">
         <HTML:IMG xmlns:HTML="http://www.w3.org/TR/REC-html40" width="286" height="341"
                   SRC="../images/tr_graph_dem_rev_engin_proc.png"
                   alt="[...]"/>
         <FigCaption>The reverse engineering procedure</FigCaption>
      </Figure>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>Generate Entity Types and Relationships from ERP Data Dictionary (tgerm1210m000)</SectionTitle>
      <Paragraph>To generate entity types and entity-type relationships by
		reverse engineering, use the <GUIRef href="/baanerp/tg/erm/tgerm1210m000" role="session">Generate Entity Types and Relationships from ERP Data Dictionary (tgerm1210m000)</GUIRef> session.</Paragraph>
      <Paragraph>Only ERP Enterprise tables entity types can be created by means of reverse engineering.</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.2" role="manual">Generate Entity Types from ERP DD...</GUIRef>; alternatively, on
		  the <Link href="/baanerp/tc/glossary/glossary#specific" role="glossary">appropriate</Link> menu of the <GUIRef href="/baanerp/tg/erm/tgerm3500m000" role="session">Entity Type Relationships (tgerm3500m000)</GUIRef> session, click <GUIRef href="/baanerp/tg/erm/tgerm3500m000#exec.user.2" role="manual">Generate Relationships from ERP DD...</GUIRef>
         </ListItem>
      </List>
      <Paragraph>The newly generated entity types and entity relationships can be
		used in existing or new entity-relationship diagrams.</Paragraph>
      <List>
         <ListIntro>To generate entity types and relationships from ERP Enterprise tables, complete
		  these steps:</ListIntro>
         <ListItem>In the <Emphasis>Table</Emphasis> fields, select the range of
		  tables for which you want to create entity types, and between which you want to
		  establish relationships.</ListItem>
         <ListItem>To create the relationships between the selected ERP Enterprise tables, select the <GUIRef href="/baanerp/tg/erm/tgerm1210m000#gen.relations" role="manual">Generate Entity Type Relationships</GUIRef> check
		  box.</ListItem>
         <ListItem>To create entity types for the selected range of ERP Enterprise tables, select the <Emphasis>Generate Entity Types</Emphasis> check box.</ListItem>
         <ListItem>In the <GUIRef href="/baanerp/tg/erm/tgerm1210m000#version" role="manual">Store into Version</GUIRef> field, select a version in which the generated entity
		  types and entity-type relationships are stored.</ListItem>
         <ListItem>Click <GUIRef href="/baanerp/tg/wfm/tgwfm1100m000#exec.user.3" role="manual">Generate</GUIRef>
         </ListItem>
      </List>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>Generate Entity Relationship Diagrams from Entity Types (tgerm1220m000)</SectionTitle>
      <Paragraph>To select a range of entity types for which you want to create
		entity-relationship, use the <GUIRef href="/baanerp/tg/erm/tgerm1220m000" role="session">Generate Entity Relationship Diagrams from Entity Types (tgerm1220m000)</GUIRef> session.</Paragraph>
      <List>
         <ListIntro>To start this session:</ListIntro>
         <ListItem>On the specific menu of the <GUIRef href="/baanerp/tg/erm/tgerm1500m000" role="session">Entity Relationship Diagrams (tgerm1500m000)</GUIRef> session, click <GUIRef href="/baanerp/tg/erm/tgerm1500m000#exec.user.1" role="manual">Generate ERD's from Ent. and Rela.</GUIRef>
         </ListItem>
         <ListItem>For each entity type, an entity-relationship diagram is added
		  in the <GUIRef href="/baanerp/tg/erm/tgerm1500m000" role="session">Entity Relationship Diagrams (tgerm1500m000)</GUIRef> session.</ListItem>
      </List>
      <List>
         <ListIntro>To create entity relationship diagrams from entity types and
		  entity type relationships, complete these steps:</ListIntro>
         <ListItem>In the <GUIRef href="/baanerp/tg/erm/tgerm1220m000#entt.f" role="manual">Entity Type</GUIRef> field, select the range of entity types for which you want to
		  create entity type relationships.</ListItem>
         <ListItem>In the <GUIRef href="/baanerp/tg/erm/tgerm1220m000#version" role="manual">Store into Version</GUIRef> field, select the version in which the entity type
		  diagrams must be stored.</ListItem>
         <ListItem>Click <GUIRef href="/baanerp/tg/wfm/tgwfm1100m000#exec.user.3" role="manual">Generate</GUIRef>
         </ListItem>
      </List>
      <Note>
         <SectionTitle> Note</SectionTitle>
         <Paragraph>If you select the <GUIRef href="/baanerp/tg/erm/tgerm1220m000#over.write.yn" role="manual">Overwrite</GUIRef> check box, entity relationship diagrams
		  that already exist in the selected version are overwritten by the newly created
		  diagrams.</Paragraph>
      </Note>
   </GeneralSection>
</ManualTopic>