




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、GettingStartedwithERwin(Erwin入門)byDr.PeterWolcottDepartmentofInformationSystemsandQuantitativeAnalysisCollegeofInformationScienceandTechnologyUniversityofNebraskaatOmaha(由內(nèi)布拉斯加州的奧馬哈大學(xué)信息科學(xué)與技術(shù)學(xué)院門的信息系統(tǒng)和定量分析博士彼得著)Introduction(介紹)EFWinisapopulardatamodelingtoolusedbyanumberofmajorcompaniesinOmahaandthrou
2、ghouttheworld。(Erwin是受奧馬哈和世界各地的一些主要的公司歡迎的數(shù)據(jù)模型工具)Theproductiscurrentlyowned,developed,andmarketedbyComputerAssociates,aleadingsoftwaredeveloper0(該產(chǎn)品是由具有領(lǐng)導(dǎo)地位的CA軟件開發(fā)公司擁有、開發(fā)和銷售)Theproductsupportsavarietyofaspectsofdatabasedesign,includingdatamodeling,forwardengineering(thecreationofadatabaseschemaandphy
3、sicaldatabaseonthebasisofadatamodel),andreverseengineering(thecreationofadatamodelonthebasisofanexistingdatabase)forawidevarietyofrelationalDBMS,includingMicrosoftAccess,Oracle,DB2,Sybase,andothers.該軟件為多種多樣的關(guān)系型數(shù)據(jù)庫管理系統(tǒng),包括MicrosoftAccess,甲骨文,Sybase,DB?和其他人提供支持?jǐn)?shù)據(jù)庫設(shè)計(jì)的各個(gè)方面,包括數(shù)據(jù)建模、正向工程(在現(xiàn)有的數(shù)據(jù)模型的基礎(chǔ)上創(chuàng)建數(shù)據(jù)模式和
4、物理數(shù)據(jù)庫)和逆向工程(在現(xiàn)在的數(shù)據(jù)庫基礎(chǔ)上創(chuàng)建數(shù)據(jù)模型)ThisbrieftutorialstepsyouthroughtheprocessofcreatingadatamodelusingERwin.(你可以通過這個(gè)簡單教程中的步驟運(yùn)用Erwin來創(chuàng)建數(shù)據(jù)模型)ItwillnotexplainallaspectsofERwin,butwillshowyoutheminimumnecessarytocreateandusedatamodelsforthisclass.(這個(gè)課程不可能全面地講解Erwin,但它向你展示了必要的最基本的創(chuàng)建和使用數(shù)據(jù)模型的知識)Itconsistsofthree
5、majorsegments,whichcorrespondtotheprojectrelatedassignmentsinyourclass:(這個(gè)課程由三個(gè)主要部分組成,它與有關(guān)項(xiàng)目任務(wù)相符)1. Creationofabasicdatamodel(Conceptualdatamodel)創(chuàng)建一個(gè)基本的數(shù)據(jù)模型(概念數(shù)據(jù)模型)2. Creationofadatabaseschema建立數(shù)據(jù)庫模式3. Creationofthedatabase創(chuàng)建數(shù)據(jù)庫Thistutorialisastaticone,suitableforprinting。本教程是一個(gè)靜態(tài)的,適合印刷Atutorialusi
6、ngscreencapturesandnarrationisalsoavailable。一個(gè)指南使用屏幕捕捉和敘述是可用的。Section1.CreationofabasicdatamodelYouwillbecreatingadatamodelsimilartothatcreatedfortheHeartlandPropertiescasestudyusedinclass.教程中你將創(chuàng)建一個(gè)和研究心臟地帶個(gè)案相似的數(shù)據(jù)模型TheEntitiesinvolvedinthismodelinclude:Employee,Office,Property,andInspection。參與本次的實(shí)體模型
7、包括:員工、辦公、財(cái)產(chǎn)、及檢驗(yàn)。First,invokeERwinfromStart-ProgramsComputerAssociates-AllFusion-ERwinDataModeler>Erwin首先,從開始-程序-CA-所有程序-ERwinDataModelerYouwillfirstencounteradialogboxentitled“ModelMartConnectionManager"(經(jīng)理ModelMart連接).SimplyclickonCancel。將首先遇到一個(gè)對話框題為“ModelMartConnectionManager".只需點(diǎn)擊“取消
8、"。Youwillbeaskedtochoosebetweencreatinganewmodel,andopeninganexistingmodel,asshowninFigure1你將被要求之間作出選擇,創(chuàng)造了一種新的模式,開放個(gè)現(xiàn)有的模型,如圖1所示。Forthisexercise,createanewmodel.通過這個(gè)練習(xí),創(chuàng)建一個(gè)新的模型Figure1:CreateanewmodelThenextdialogbox,showninFigure2,willaskyoutochoosethetemplatetobeusedtocreatethenewmodel。下一個(gè)對話框,如
9、圖2所示,會讓你選擇的模板可以被用來創(chuàng)造新的模型Atthispoint,youmayassociatethemodelwithatargetDBMroduct,suchasMicrosoftAccess,Oracle,DBZetc。在這一點(diǎn)上,你可以把這個(gè)模型與如MicrosoftAccess,甲骨文,DB2等目標(biāo)數(shù)據(jù)庫產(chǎn)品聯(lián)系在一起Youwillhavetheopportunitytochangethischoicelater,butfornowchooseMicrosoftAccess。你之后將有機(jī)會改變這種選擇,但是現(xiàn)在選擇MicrosoftAccessoAlso,chooseLogic
10、al/Physicalasthenewmodeltype。同時(shí),選擇的邏輯或者物理彳為新模型形式Thischoicewillallowustoswitchbackandfortheasilybetweenalogicalmodel(ERDiagram)andaphysicalmodel(databaseschema).這個(gè)選擇將讓我們輕易之間來回切換邏輯模型(ER圖)和物理模型(資料庫)Figure2:SelectingamodeltypeERwinwillnowdisplaythemainwindowfromwhichmostofyourERdiagramdevelopmentwillbed
11、one,asshowninFigure3.ERwin現(xiàn)在將顯示在主窗口大部分你ER圖發(fā)展來完成,如圖3。' Computer Asoci dies ERivin - Model 1 : <Mapn Subject Area := / Displd y 1|n|_x際FMEditViewFormatModalModef4artTookWindowHetU<91X口空口|8|黝"l耳甲©虱我錢口|04|LogicaljJJ時(shí)晶J弊直網(wǎng)-3厄三JI上皿I、:港府金角金.日011tli1QOOoaT1-'蟀i+E20orpins_J理WodelSourc
12、es”ValidationRuleswDehukValues可TiansfwmsQEntitiesEfSubjectAreasFigure 3: The ERwin Workplace ERwin工作場所TheERwinworkplaceconsistsoftwomainparts.OntheleftistheModelNavigator,whichdisplaysahierarchyofitemsofimportance,suchasentities,domains,andsubjectareas.左面是模型的領(lǐng)航員,顯示某層次的物品的重要性,如實(shí)體、領(lǐng)域和課題。Ontherightisth
13、eDisplayWindowwhichwillshowtheERdiagramitself。右邊是顯示窗口,它能夠顯示ER圖本身Asyoucreateobjects,theywillappearinthedisplaywindow(iftheyarevisualinnature,likeentities),andappearinthehierarchywithintheModelNavigator.當(dāng)你創(chuàng)建對象時(shí),他們將會出現(xiàn)在顯示器窗口(如果它們是視覺的自然屬性,就像實(shí)體),并將出現(xiàn)在層級模型導(dǎo)航器.SettingPreferences偏好設(shè)置AtoollikeERwincanaccomod
14、ateanumberofdatamodelingnotationsandconventions。像ER這樣工具可以容納大量的數(shù)據(jù)建模的符號和對話Inmyclasspleasemakethefollowingchangestothepreferencesbeforeyoubegintocreateyourmodel在我的課上請完成下面的改變的偏好,在你開始之前,創(chuàng)造你的模型:1. FromtheFormat>EntityDisplaymenu,makesurethatPrimaryKeyDesignatorischecked從格式>實(shí)體顯示菜單,確保主鍵欄進(jìn)行檢查2. Fromthe
15、Format-EntityDisplaymenu,makesurethatForeignKeyDesignator(FK)isunchecked0從格式-實(shí)體顯示菜單,確保外國關(guān)鍵指示器(FK)是不能檢查3. FromtheFormat>EntityDisplaymenu,makesurethatShowMigratedAttributesisunchecked.從格式>實(shí)體顯示菜單,確保顯示屬性遷移至ijunchecked4. FromtheFormat->RelationshipDisplay,makesurethatVerbPhraseischecked.從格式一關(guān)系顯
16、示、確保動詞短語進(jìn)行檢查Inaddition,youmaychoosebetweentwodifferentERdiagrammingnotations。另外,你可以選擇兩種不同的e-r種畫圖符號InERwin,clickonModel-ModelPropertiestoseethewindowshowninFigure3b:點(diǎn)擊模型一>窗口模型屬性看到如圖3b。ModelProperties6ensralDefinitionnotationDefaultsIHIDeFaullsUDFHistoryOptior>sHistoryLogicalNotationIDEF1X0rtegr
17、ationDEFinitianfoiInfermatianModelrgj衣IEInforntionEngineeringPhysicalHalation-IDEF11(IntegrationDEFinidonfofInformationModeling)"遮PnformafieriErigineeringl0K(DmenaonalModeling)CancelFigure3b:Choiceofnotation("Crows Foot ”)notation. You may also use IDEF1X,if you wish 。本教程是基于信息工程("烏鴉腳”
18、)的符號你也可以使用IDEF1X,如果你愿意的話。Creating an Entity創(chuàng)造一個(gè)實(shí)體To create a new entity,click on theentity icon ()on the toolbar ,ThistutorialisbasedontheInformationEngineering創(chuàng)建一個(gè)新orrightclickonthewordEntityintheModelNavigator。的實(shí)體,點(diǎn)擊實(shí)體工具欄上的圖標(biāo)(),或者以右鍵點(diǎn)擊這個(gè)詞中的實(shí)體模型導(dǎo)航器Ifyouclickontheentityicon,youthenshouldclickonthe,a
19、s shown inDisplayWindowwhereyouwouldliketheentitytoappearD om-ains Model 5 ources Validation Rule6 Default Values T rdnforms Entities SubieclA(eas冽 File Edit View Format Model ModeMaft Tools 刷indow Help Computer rtssoci ales ER win - Model I * ; <Main Subject Area? f Displ aylFigure 4.如果你點(diǎn)擊了實(shí)體圖標(biāo),
20、那么你應(yīng)該點(diǎn)擊顯示窗口,在那里你會喜歡 這個(gè)實(shí)體出現(xiàn)的各位朋友,如圖4所示.Lx|4| x田廣:;:一;田:由ill& MdelR Su.Q c*o.后朝dpFigure4:AnewentityNoticethatthedefaultnamefortheentityisE/x,wherexissomenumber(2inthiscase)。注意,默認(rèn)的名字因?yàn)閷?shí)體是E/x,那里的x是一些數(shù)字(2在這種情況下)ClickontheTabkeyseveraltimesandnoticewhathappens。點(diǎn)擊Tab鍵了好幾次,通知會發(fā)生些什么Pressingthetabkeycause
21、thefocustocyclebetweenthethreemainpartsoftheEntity:按tab鍵引起關(guān)注焦點(diǎn),周期之間的三個(gè)主要部分的實(shí)體thenameoftheentity,theprimarykeyattribute(s)主要的關(guān)鍵屬性,andthenon-primarykeyattribute(s)時(shí)速的關(guān)鍵屬性(s).Ingeneral,tomodifyoneofthesethreepartsoftheentity,youwillpresstheTabkeytocycletotheappropriatepartoftheentity,thentypetoaddormod
22、ifythatpartoftheentity。一般來說,修改這三部分的實(shí)&你會按Tab鍵循環(huán)到適寸的一部分,然后輸入實(shí)體的增加或修改的那部分實(shí)體Rightnow,presstheTabkeyuntiltheentitynameishighlighted.現(xiàn)在,按Tab鍵,直到實(shí)體名稱是突出了ThentypeEMPLOYEEisshowninFigure5。然后輸入雇員,如圖5.Figure5:ChangingthenameoftheentityAtthispoint,youmaywishtosaveandnameyourdiagramtoavoidlossshouldthesystem
23、orapplicationcrash.在這一點(diǎn)上,你可能想要存起來,說出你的圖來避免損失應(yīng)該系統(tǒng)或應(yīng)用程序崩潰.Addingprimarykeycolumns添力主鍵字段OnceyouhavechangedthenametoEMPLOYEE:,presstheTabkeyagaintomovethefocustothenextpartoftheEntity,addingaprimarykeyattribute。一旦你已經(jīng)更改了名稱給員工,按Tab鍵來移動焦點(diǎn)再下一部分的實(shí)體,添力個(gè)關(guān)鍵屬性Thentypethenameoftheprimarykeyattribute,Emp_Num,assho
24、wninFigure6。然后輸入名稱的屬性,Emp_Numt鍵,如圖6.Figure6:AddingaprimarykeyattributeNoticethatbecauseofthepreferencesyousetearlier,theprimarykeyattributehasakeyiconnexttoit。值得注意的是,因?yàn)槟愕南埠迷O(shè)定早些時(shí)候,主鍵的屬性是一個(gè)關(guān)鍵的圖標(biāo)旁邊。PresstheTabkeyonemoretimetobringthefocusbelowthehorizontallineintheEntity,whereyouwilladdinanumberofnon-p
25、rimarykeyattributes。按Tab鍵遍把焦點(diǎn)的水平線以下的實(shí)體,在那里您將加入一定數(shù)量的時(shí)速關(guān)鍵屬性。TypeEmp_Fnam|easshowninFigure7.Emp_Fnamffi,如圖7WhenyouhavetypedEmp_NamepresstheEnterkey(notTab)當(dāng)你打了Emp_Name按回車鍵(不是選項(xiàng)卡)。Noticewhathappens當(dāng)你學(xué)得。ThecursorisnowpositionedforyoutoaddanotherattributeinthissameportionoftheEntity,thenon-primarykeyattri
26、buteportion。定位光標(biāo)被現(xiàn)在你添加另一個(gè)屬性在這個(gè)相同的部分實(shí)體、時(shí)速關(guān)鍵屬性分.Figure7:AddingnonprimarykeyattributesContinueaddingthefollowingnonprimarykeyattributes:繼續(xù)增力口下列時(shí)速關(guān)鍵屬性:Emp_LnameEmp_SSNEmp_StreetEmp_CityEmp_StateEmp_ZipcodeEmp_PhoneEmp_FaxYourdiagramshouldnowlooklikeFigure8Figure8:TheEmployeeentityRepeattheentitycreation
27、processfortheentitiesandattributeslistedinTable1。重復(fù)這個(gè)實(shí)體創(chuàng)建過程中為實(shí)體及其屬性列于表1。EntityAttributesEntityAttributesOFFICEOffice_Num(pk)Office_StreetOffice_CityOffice_StateOffice_ZipcodeOffice_NameOffice_PhoneOffice_FaxINSPECTIOInsp_Date(pk)Insp_CommentsPROPERYProp_ID(pk)MANAGERMan_SalaryProp_StreetProp_CityPro
28、p_StateProp_TypeProp_BathsProp_RoomsPropMonthlyRentMan CarASSOCIATEAssocHourlyRateTable1:EntitiesandAttributesNoticethatsomeoftheentitieshavenoprimarykeyattributes(Manager,Associate),andoneentityhasanattributewhichispartoftheprimarykey,butbyitselfdoesnotconstituteaprimarykey(Inspection)。注意到一些實(shí)體屬性沒有主
29、鍵(經(jīng)理、副),和一個(gè)實(shí)體有一個(gè)屬性的一部分,而是由主鍵本身并不會構(gòu)成一個(gè)主鍵(檢驗(yàn))oAsweaddrelationshipstothediagram,thenatureofthekeysfortheseentitieswillbecomeclear。當(dāng)我們添加關(guān)系圖,大自然的鑰匙,這些實(shí)體就變得清晰了Forthetimebeing,besurethattherearenoprimarykeyattributesforManagerandAssociate,andonlyoneprimarykeyattributeforInspection,asshowninFigure9.隨著時(shí)間的推移,
30、要確保沒有關(guān)鍵屬性對經(jīng)理及員工,只有一個(gè)主要的關(guān)鍵屬性進(jìn)行檢驗(yàn),如圖9所示,Lumputer Associates ERwin - TUTORIALER Is* : <Mair> Subject Area> / Di鈍場File Edit Wew Format Model ModdP4arE Tools Window HelpJn| X ,|g| XpFFlCE 喝口片足電Murn,! U曲.包住步D orruinsModel S ources Validation Rules Dehuk Values T rarpsfwm?Entities Subject AreasEm
31、pFname Emp_Ln舊 e電 Emp_SSN Emp_Gtrfi*t Emp.Ci 句 Em p_Staie Emp ipcoda EmpFhQFfce £mp_Q 'E 前WYEE a Emp_NumINSPECTIONin5p_DateMAWAERASSOCIATEMjr)_SaljryMdnCdr AllswjneeAw6C_Hi url_RateA ModelW Su.ispIcStrtei OfllwZcityQltlc< _Z>wde 口怖cjHam也 OfflM_PhdrTe 0-HIm F axPROPERTYProp_Gtreet Picp
32、_Cit)K Propw State Prop.Zipcode Prop Type FQp_ Baths PropRflQmsF Pirop_M onthlyRentidRedyAccessFigure9:HeartlandPropertiesEntitiesCreatingRelationships建立人際關(guān)系EFWinsupportsthecreationofrelationshipswiththreebasickindsofconnectivity(EFWin支持創(chuàng)造之間的關(guān)系三種基本的連通性:oneto-one,one-tomanyandmanyto-many。Withintheone
33、tomanycategory,ERwinallowsustodistinguishbetweenidentifyingandnon-identifyingone-tomanyrelationships。這對范疇,ithin歐文允許我們區(qū)分識別和nonidentifying一對多的關(guān)系.OnetomanyRelationshipsWellbeginwithtworelationships,betweenInspectionandEmployeeandbetweenInspectionandProperty。我們可以先開始兩個(gè)關(guān)系,檢驗(yàn)和員工之問,檢驗(yàn)和財(cái)產(chǎn)的權(quán)利之間Inspectionisrel
34、atedtobothPropertyandEmployee in one to many relationships同時(shí)與檢驗(yàn)是財(cái)產(chǎn)和員工在一對多的關(guān)系EachInspectionisundertakenatoneProperty;在進(jìn)行每個(gè)檢查是套房產(chǎn)eachPropertymayundergomanyinspections每處房產(chǎn),可能經(jīng)過許多檢查。EachInspectioniscarriedoutbyoneEmployee每次檢驗(yàn)進(jìn)行了一名員工;eachEmployeecarriesoutmanyInspections每一位員工進(jìn)行許多檢查.Aretheserelationshipsi
35、dentifyingrelationshipsornon-identifyingrelationships?這些是關(guān)系識別關(guān)系或nonidentifying關(guān)系嗎?Aretheserelationshipsidentifyingrelationshipsornonidentifyingrelationships?這些是關(guān)系識另關(guān)系或nonidentifying關(guān)系嗎?TheissuehingesonthenatureoftheprimarykeyofInspection,theentityonthe“manysideoftherelationship。問題的關(guān)鍵在于性質(zhì)的主鍵的檢驗(yàn)、實(shí)體上的“
36、許多”方面的關(guān)系。TheprimarykeyofInspectioninthisexampleisacompositeprimarykeyconsistingoftwoattributes主鍵的檢驗(yàn)在本例中是一個(gè)合成物,主鍵由兩個(gè)屬性:Insp_Date,Prop_IDThebusinessruleineffecthereisthateachpropertyhasatmostoneinspectionperdayInsp_DateProp_ID的商業(yè)規(guī)則,在這里,每一種性質(zhì)影響的條件下,在大多數(shù)人檢查每天。Onemightarguewhetherornotthatisasoundassumpt
37、ion,butletssupposeforthesakeofillustrationthatitis。一個(gè)人可能會爭辯說不管那是一種合理的假設(shè),但為了說明我們可以假設(shè)它是.NoticethattheprimarykeyofInspectionincludestheprimarykeyofProperty,theentitywithwhichithasarelationship.值得注意的是,主鍵檢查包括主鍵的性質(zhì)、實(shí)體與它有關(guān)系Forthisreason,wesaythattherelationshipbetweenInspectionandPropertyisanidentifyingone
38、to-manyrelationship.因?yàn)檫@個(gè)原因,我們說,檢驗(yàn)和財(cái)產(chǎn)之間的關(guān)系是一種識別一對多的關(guān)系。Anidentifyingrelationshipiscreatedbyclickingfirstontheidentifyingrelationshipicon(").創(chuàng)建一個(gè)識別關(guān)系是通過點(diǎn)擊第一的在識別關(guān)系圖標(biāo)()Noticethatithasthecrow'sfootnotation(indicating"many")andasolidline(indicatingidentifying)。值得注意的是,它有烏鴉腳的符號(表示“許多”)和一個(gè)實(shí)
39、線(指著識別)Tocreateanidentifyingrelationship,clickfirstonthisicon,thenclickontheparententity(ontheonesideoftherelationship)andthenclickonthechildentity(onthemanysideoftherelationship)。倉I建個(gè)識別關(guān)系,點(diǎn)擊先在這個(gè)圖標(biāo),然后點(diǎn)擊“家長實(shí)體(在這邊的關(guān)系),然后點(diǎn)擊孩子實(shí)體(在許多一端的關(guān)系)Inthiscase,youwillclickfirstontheidentifyingrelationshipicon,theno
40、nProperty,thenonInspection.在這種情況下,你就會點(diǎn)擊圖標(biāo)先識別,然后在產(chǎn)權(quán)關(guān)系,然后在檢查TheresultsareshowninFigure10.結(jié)果顯示于圖10Figure10:AnidentifyingrelationshipNoticethatERvinhasprovidedalabel"R/1"fortherelationship,whichisnotveryhelpful。值得注意的是,ERwin已經(jīng)提供了一個(gè)標(biāo)簽”R/1"的關(guān)系,而不是很有幫助Double-clickontherelationshipitselftobrin
41、gupadialogboxinwhichwecanfurtherrefinetherelationshipdefinition雙擊關(guān)系本身造就了一個(gè)對話框,以這種方式我們能夠進(jìn)一步提煉的關(guān)系的定義。FilloutthisdialogboxasshowninFigure11.填寫這對話框如圖11分Figure11:RelationshipsdefinitionIntheRelationship:textboxtherelationshipispresentedintheformparententityR/1childentity.在這段關(guān)系的關(guān)系:文本框的形式給出了R/1孩子家長實(shí)體的實(shí)體The
42、VerbPhraseportionofthisboxallowsustodefinethelabeltoplaceontherelationshipinplaceofR/1.這個(gè)動詞短語的一部分,這盒允許我們來定義標(biāo)簽的地方的關(guān)系上所處的R/1SincetheparententityisPropertyandtheChildentityisInspection,theParenttoChildverbphrasewillread“PropertyUndergoesInspection.”自從父母實(shí)體是財(cái)產(chǎn)和孩子的主體是檢查、Parent-toChild動詞短語會讀”財(cái)產(chǎn)經(jīng)歷檢查."T
43、heChildtoParentverbphrasewillread”InspectionUndertakenatProperty。"動詞短語的Child一to-Parent會讀”的檢測在進(jìn)行財(cái)產(chǎn)?!盜ntheRelationshipCardinalityportionofthiswindow,wecandeterminehowmanychildentityoccurencesmaybeassociatedwitheachparententityoccurence.人際關(guān)系的行集數(shù)的一部分,這窗戶,我們可以決定了有多少孩子實(shí)體檢測儀可伴有每個(gè)父母實(shí)體發(fā)生Morespecifically
44、,"OnePropertyUndergoesZero,OneorMoreInspections.”更具體地說,“一個(gè)財(cái)產(chǎn)經(jīng)歷零,一個(gè)或更多的檢查.”Noticethatatthispointwearealsoabletodefineparticipation.值得注意的是,在這一點(diǎn)上我們也能夠定義的參與。Ifeachpropertyhadtohaveundergoneatleastoneinspectioninordertobestoredinthedatabase,thenwecouldhaveforcedmandatoryparticipationbychoosingtheOne
45、orMoreoption。如果每個(gè)貝才產(chǎn)不得不經(jīng)歷了至少一個(gè)檢測為了被儲存在數(shù)據(jù)庫中,那么,我們就可以迫使強(qiáng)制性參與挑選一個(gè)或更多的選擇.ClickOKtocompletetherelationshipdefinition,asshowninFigure12。點(diǎn)擊OK完成關(guān)系定義,如圖12。Figure12:FinishedrelationshipNoticethatwhenanentityparticipatesasthechildinanidentifyingrelationshipitismodeledwithroundedcorners.值得注意的是,當(dāng)個(gè)實(shí)體作為識別的關(guān)系那孩子是模仿
46、和圓角。Thisnotationisusedforwhatinotherdatamodelingtoolsiscalleda”WeakEntity"。這個(gè)符號是用來在其他數(shù)據(jù)建模工具,一種被稱為“弱單位”。TherelationshipbetweenInspectionandEmployeeissomewhatdifferent。檢查和員工之間的關(guān)系是有不同的.Itisaone-tomanyrelationship,butitisnonidentifying,becausetheprimarykeyofEmployeeisnotpartoftheprimarykeyofInspect
47、ion.這是個(gè)對多的關(guān)系,但它是nonidentifying中的主鍵,因?yàn)楣蛦T沒有部分的主鍵檢查Forsucharelationship,wemustclickonthenonidentifyingrelationshipiconJ、(,),whichusesadashedlineinsteadofasolidline。對于這樣一個(gè)關(guān)系,我們必須點(diǎn)擊屏幕上的圖標(biāo)(:),它使用一個(gè)虛線來代替一個(gè)實(shí)線。Asbefore,weclickontheicon,thentheparententity,thenthechildentity。和以前一樣,我們點(diǎn)擊這個(gè)圖標(biāo),那么父的實(shí)體,然后孩子的實(shí)體Click
48、onthenon-identifyingrelationshipicon,thentheEmployeeentity,thentheInspectionentity.點(diǎn)擊屏幕上的圖標(biāo),然后nonidentifying員工關(guān)系實(shí)體,然后檢驗(yàn)實(shí)體Double-clickontherelationshiptobringuptherelationshipdefinitionwindowandfillitinasshowninFigure13.oubleclick的關(guān)系來定義窗口和關(guān)系把它填上如圖13歲。Figure 13 : Non-identifying relationship definitio
49、noAsbefore,weprovidemoremeaningfulverbphrasesfortherelationship.和以前一樣,我們提供更多的有意義的動詞短語的關(guān)系A(chǔ)sbefore,sinceeachemployeemaybeassociatedwithzero,oneormoreinspections,wechoosethecorrespondingcardinality。和以前一樣,因?yàn)槊總€(gè)員工可能伴有零,一個(gè)或多個(gè)檢查,我們選擇相應(yīng)的行集數(shù)Unlikebefore,whenwechosetheidentifyingrelationshiptype,wehavenowchose
50、nthenonidentifyingrelationshiptype。不同于以往的,當(dāng)我們選擇了識別關(guān)系類型,我們現(xiàn)在已經(jīng)選好了nonidentifying關(guān)系類型.Wehavetheoptionofindicatingwhethernullsarepermittedornot。我們可以選擇是否允許nulls表示。Thisdecisionregardstheparticipationoftheparententityinarelationshipwiththechildentity。這一決定將參與實(shí)體的父母與孩子的關(guān)系實(shí)體。Inotherwords,doeseachchildentityocc
51、urence(Inspection)havetobeassociatedwithaparententityoccurence(Employee)?換句話說,每一個(gè)孩子的實(shí)體(檢查)發(fā)生有助于家長實(shí)體發(fā)生(雇員)嗎?Inthiscase,theansweryes。Eachinspectionmustbecarriedoutbyanemployee,oritisnotconsideredaproperinspection.在這種情況下,答案是的.每項(xiàng)考核必須執(zhí)行一個(gè)雇員,或并不被認(rèn)為是一個(gè)適當(dāng)?shù)臋z驗(yàn)。TheparticipationofEmployeeintherelationshipismand
52、atory。在參與的員工之間的關(guān)系是強(qiáng)制性的.ClickOKtocompletetherelationshipdefinition,asshowninFigure14.點(diǎn)擊OK完成關(guān)系定義,如圖14。,ln| x創(chuàng)座。& ® M 午呻窣 R觀以蚊囪士 Logical的晶需攝|tal刁b y u Ti空柏士修士D omins Model Sources Validation Rules Default Values T rarafo(mis E ntities G object Areas器 ModelR Su.Q g.irri" itit i srd亡t outFh
53、鄒匚GEE凸MSEtVlFLOYEEErnf>_NumEmpFname EinpLri ame Emp_SSN Em_ Street Einp=Cit Emp_ Slate Einp_Zipcode EmpPlhone Em& Fm靈IM5PE 匚 T【ONlfi5P_DateUrid巨用 UndeitASSOCIATEMjr)_S3ljryMan l且I Allov'ianGepmcE嗎 口ffi收 NumIcStrtei OfllwZcity Office _Z>wde 口怖cjHam也 OfflM_PhdrTe Off it* F axPROPERTYProp
54、_Gtreet Picp_Cit)K Prop_ Sta-te Prpp_Zipffldt FTop Type FQp_ Baths PQp_Rwm£ Pirop_M onthlyRent小03h eid、Computer酉號so口dtE,ERwin-TUTORIALER1=*:<MainSubjectArea>/Display1引'FiteEditViewFormatModelModdP4arEToolsWindowHelpR6dyAcces?Figure14:NonidentifyingrelationshipEmployeeandOfficealsopart
55、icipationinarelationshipwitheachother。員工和辦公室也參與相互認(rèn)識EachEmployeeisassignedtooneandonlyoneOffice,andeachOfficehasoneormoreEmployees。每個(gè)員工被指定至U唯一的一間辦公室,每個(gè)辦公室都擁有一個(gè)或更多的員工。Inthisonetomanyrelationship,OfficeistheparentandEmployeeisthechild.在這一對多的關(guān)系,辦公室是家長和員工是孩子。Sincetheprimarykeyofthechild(Employee)doesnoti
56、ncludetheprimarykeyoftheparent(Office),thisisanonidentifyingrelationship。自從主鍵的孩子(雇員)并不包括主鍵的父母(辦公室),這是一個(gè)nonidentifying關(guān)系。Clickonthenonidentifyingrelationshipicon,Office,andEmployeetocreatethisrelationship.點(diǎn)擊屏幕上的圖標(biāo)non-identifying關(guān)系、寫字樓及員工,形成了這種關(guān)系。Double-clickontherelationshipandf川intherelationshipdefi
57、nitionwindowasshowninFigure15。雙擊關(guān)系并填入關(guān)系定義窗口如圖15。Figure15:AnonidentifyingrelationshipwithmandatoryparticipationInFigure15,seeanexampleofarelationshipinwhichparticipationismandatoryforbothentities。在圖15,看一個(gè)例子,這樣一種關(guān)系,參與對雙方都是強(qiáng)制性的實(shí)體TheCardinalityindicatesthateachOfficeisassociatedwithOneorMore(butnotZero)Employees。每間辦公室的行集數(shù)表明,伴隨著一個(gè)或多個(gè)(但不是零)的雇員.TheRelationshipTypeindicatesthatthisisanon-identifyingrelationship,andthatNullsarenotpermitted.他的關(guān)系類型顯示,這是一個(gè)non-identifying關(guān)系,Nul
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 圖書修復(fù)與保護(hù)保證館藏書籍的保存質(zhì)量計(jì)劃
- 專業(yè)品牌營銷團(tuán)隊(duì)的組建要點(diǎn)計(jì)劃
- 腦卒中的預(yù)防和護(hù)理
- 發(fā)展團(tuán)隊(duì)領(lǐng)導(dǎo)能力提升團(tuán)隊(duì)士氣計(jì)劃
- 社團(tuán)工作的組織和具體安排計(jì)劃
- 四川峨邊華竹溝礦業(yè)開發(fā)有限公司華竹溝磷礦礦山地質(zhì)環(huán)境保護(hù)與土地復(fù)墾方案情況
- 茶飲店基礎(chǔ)知識培訓(xùn)課件
- 肺部粒子植入患者護(hù)理
- 2025年曲靖貨運(yùn)車從業(yè)考試題
- 2025年黔東南貨車資格證考試題
- 花城版三年級上冊音樂教學(xué)計(jì)劃
- GB/T 31821-2015電梯主要部件報(bào)廢技術(shù)條件
- GB/T 17574.11-2006半導(dǎo)體器件集成電路第2-11部分:數(shù)字集成電路單電源集成電路電可擦可編程只讀存儲器空白詳細(xì)規(guī)范
- 快手磁力聚星知識考試題庫及答案
- 學(xué)校衛(wèi)生監(jiān)督協(xié)管巡查記錄
- 《勾股定理在實(shí)際生活中的應(yīng)用》教學(xué)反思
- 游泳池給水排水安裝工程識圖
- 配位鍵和配位化合物課件
- 政 審 表打印模板
- 成人心肺復(fù)蘇(雙人)課件
- 蘇教版數(shù)學(xué)二年級下冊《認(rèn)識時(shí)分》教案(無錫公開課)
評論
0/150
提交評論