ERwin使用說(shuō)明(中英文)_第1頁(yè)
ERwin使用說(shuō)明(中英文)_第2頁(yè)
ERwin使用說(shuō)明(中英文)_第3頁(yè)
ERwin使用說(shuō)明(中英文)_第4頁(yè)
ERwin使用說(shuō)明(中英文)_第5頁(yè)
已閱讀5頁(yè),還剩19頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

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軟件開(kāi)發(fā)公司擁有、開(kāi)發(fā)和銷售)Theproductsupportsavarietyofaspectsofdatabasedesign,includingdatamodeling,forwardengineering(thecreationofadatabaseschemaandphy

3、sicaldatabaseonthebasisofadatamodel),andreverseengineering(thecreationofadatamodelonthebasisofanexistingdatabase)forawidevarietyofrelationalDBMS,includingMicrosoftAccess,Oracle,DB2,Sybase,andothers.該軟件為多種多樣的關(guān)系型數(shù)據(jù)庫(kù)管理系統(tǒng),包括MicrosoftAccess,甲骨文,Sybase,DB?和其他人提供支持?jǐn)?shù)據(jù)庫(kù)設(shè)計(jì)的各個(gè)方面,包括數(shù)據(jù)建模、正向工程(在現(xiàn)有的數(shù)據(jù)模型的基礎(chǔ)上創(chuàng)建數(shù)據(jù)模式和

4、物理數(shù)據(jù)庫(kù))和逆向工程(在現(xiàn)在的數(shù)據(jù)庫(kù)基礎(chǔ)上創(chuàng)建數(shù)據(jù)模型)ThisbrieftutorialstepsyouthroughtheprocessofcreatingadatamodelusingERwin.(你可以通過(guò)這個(gè)簡(jiǎn)單教程中的步驟運(yùn)用Erwin來(lái)創(chuàng)建數(shù)據(jù)模型)ItwillnotexplainallaspectsofERwin,butwillshowyoutheminimumnecessarytocreateandusedatamodelsforthisclass.(這個(gè)課程不可能全面地講解Erwin,但它向你展示了必要的最基本的創(chuàng)建和使用數(shù)據(jù)模型的知識(shí))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ù)庫(kù)模式3. Creationofthedatabase創(chuàng)建數(shù)據(jù)庫(kù)Thistutorialisastaticone,suitableforprinting。本教程是一個(gè)靜態(tài)的,適合印刷Atutorialusi

6、ngscreencapturesandnarrationisalsoavailable。一個(gè)指南使用屏幕捕捉和敘述是可用的。Section1.CreationofabasicdatamodelYouwillbecreatingadatamodelsimilartothatcreatedfortheHeartlandPropertiescasestudyusedinclass.教程中你將創(chuàng)建一個(gè)和研究心臟地帶個(gè)案相似的數(shù)據(jù)模型TheEntitiesinvolvedinthismodelinclude:Employee,Office,Property,andInspection。參與本次的實(shí)體模型

7、包括:?jiǎn)T工、辦公、財(cái)產(chǎn)、及檢驗(yàn)。First,invokeERwinfromStart-ProgramsComputerAssociates-AllFusion-ERwinDataModeler>Erwin首先,從開(kāi)始-程序-CA-所有程序-ERwinDataModelerYouwillfirstencounteradialogboxentitled“ModelMartConnectionManager"(經(jīng)理ModelMart連接).SimplyclickonCancel。將首先遇到一個(gè)對(duì)話框題為“ModelMartConnectionManager".只需點(diǎn)擊“取消

8、"。Youwillbeaskedtochoosebetweencreatinganewmodel,andopeninganexistingmodel,asshowninFigure1你將被要求之間作出選擇,創(chuàng)造了一種新的模式,開(kāi)放個(gè)現(xiàn)有的模型,如圖1所示。Forthisexercise,createanewmodel.通過(guò)這個(gè)練習(xí),創(chuàng)建一個(gè)新的模型Figure1:CreateanewmodelThenextdialogbox,showninFigure2,willaskyoutochoosethetemplatetobeusedtocreatethenewmodel。下一個(gè)對(duì)話框,如

9、圖2所示,會(huì)讓你選擇的模板可以被用來(lái)創(chuàng)造新的模型Atthispoint,youmayassociatethemodelwithatargetDBMroduct,suchasMicrosoftAccess,Oracle,DBZetc。在這一點(diǎn)上,你可以把這個(gè)模型與如MicrosoftAccess,甲骨文,DB2等目標(biāo)數(shù)據(jù)庫(kù)產(chǎn)品聯(lián)系在一起Youwillhavetheopportunitytochangethischoicelater,butfornowchooseMicrosoftAccess。你之后將有機(jī)會(huì)改變這種選擇,但是現(xiàn)在選擇MicrosoftAccessoAlso,chooseLogic

10、al/Physicalasthenewmodeltype。同時(shí),選擇的邏輯或者物理彳為新模型形式Thischoicewillallowustoswitchbackandfortheasilybetweenalogicalmodel(ERDiagram)andaphysicalmodel(databaseschema).這個(gè)選擇將讓我們輕易之間來(lái)回切換邏輯模型(ER圖)和物理模型(資料庫(kù))Figure2:SelectingamodeltypeERwinwillnowdisplaythemainwindowfromwhichmostofyourERdiagramdevelopmentwillbed

11、one,asshowninFigure3.ERwin現(xiàn)在將顯示在主窗口大部分你ER圖發(fā)展來(lái)完成,如圖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工作場(chǎng)所TheERwinworkplaceconsistsoftwomainparts.OntheleftistheModelNavigator,whichdisplaysahierarchyofitemsofimportance,suchasentities,domains,andsubjectareas.左面是模型的領(lǐng)航員,顯示某層次的物品的重要性,如實(shí)體、領(lǐng)域和課題。Ontherightisth

13、eDisplayWindowwhichwillshowtheERdiagramitself。右邊是顯示窗口,它能夠顯示ER圖本身Asyoucreateobjects,theywillappearinthedisplaywindow(iftheyarevisualinnature,likeentities),andappearinthehierarchywithintheModelNavigator.當(dāng)你創(chuàng)建對(duì)象時(shí),他們將會(huì)出現(xiàn)在顯示器窗口(如果它們是視覺(jué)的自然屬性,就像實(shí)體),并將出現(xiàn)在層級(jí)模型導(dǎo)航器.SettingPreferences偏好設(shè)置AtoollikeERwincanaccomod

14、ateanumberofdatamodelingnotationsandconventions。像ER這樣工具可以容納大量的數(shù)據(jù)建模的符號(hào)和對(duì)話Inmyclasspleasemakethefollowingchangestothepreferencesbeforeyoubegintocreateyourmodel在我的課上請(qǐng)完成下面的改變的偏好,在你開(kāi)始之前,創(chuàng)造你的模型:1. FromtheFormat>EntityDisplaymenu,makesurethatPrimaryKeyDesignatorischecked從格式>實(shí)體顯示菜單,確保主鍵欄進(jìn)行檢查2. Fromthe

15、Format-EntityDisplaymenu,makesurethatForeignKeyDesignator(FK)isunchecked0從格式-實(shí)體顯示菜單,確保外國(guó)關(guān)鍵指示器(FK)是不能檢查3. FromtheFormat>EntityDisplaymenu,makesurethatShowMigratedAttributesisunchecked.從格式>實(shí)體顯示菜單,確保顯示屬性遷移至ijunchecked4. FromtheFormat->RelationshipDisplay,makesurethatVerbPhraseischecked.從格式一關(guān)系顯

16、示、確保動(dòng)詞短語(yǔ)進(jìn)行檢查Inaddition,youmaychoosebetweentwodifferentERdiagrammingnotations。另外,你可以選擇兩種不同的e-r種畫圖符號(hào)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、)的符號(hào)你也可以使用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)擊顯示窗口,在那里你會(huì)喜歡 這個(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鍵了好幾次,通知會(huì)發(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。一般來(lái)說(shuō),修改這三部分的實(shí)&你會(huì)按Tab鍵循環(huán)到適寸的一部分,然后輸入實(shí)體的增加或修改的那部分實(shí)體Rightnow,presstheTabkeyuntiltheentitynameishighlighted.現(xiàn)在,按Tab鍵,直到實(shí)體名稱是突出了ThentypeEMPLOYEEisshowninFigure5。然后輸入雇員,如圖5.Figure5:ChangingthenameoftheentityAtthispoint,youmaywishtosaveandnameyourdiagramtoavoidlossshouldthesystem

23、orapplicationcrash.在這一點(diǎn)上,你可能想要存起來(lái),說(shuō)出你的圖來(lái)避免損失應(yīng)該系統(tǒng)或應(yīng)用程序崩潰.Addingprimarykeycolumns添力主鍵字段OnceyouhavechangedthenametoEMPLOYEE:,presstheTabkeyagaintomovethefocustothenextpartoftheEntity,addingaprimarykeyattribute。一旦你已經(jīng)更改了名稱給員工,按Tab鍵來(lái)移動(dòng)焦點(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)建過(guò)程中為實(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í)體屬性沒(méi)有主

29、鍵(經(jīng)理、副),和一個(gè)實(shí)體有一個(gè)屬性的一部分,而是由主鍵本身并不會(huì)構(gòu)成一個(gè)主鍵(檢驗(yàn))oAsweaddrelationshipstothediagram,thenatureofthekeysfortheseentitieswillbecomeclear。當(dāng)我們添加關(guān)系圖,大自然的鑰匙,這些實(shí)體就變得清晰了Forthetimebeing,besurethattherearenoprimarykeyattributesforManagerandAssociate,andonlyoneprimarykeyattributeforInspection,asshowninFigure9.隨著時(shí)間的推移,

30、要確保沒(méi)有關(guān)鍵屬性對(duì)經(jīng)理及員工,只有一個(gè)主要的關(guān)鍵屬性進(jìn)行檢驗(yàn),如圖9所示,Lumputer Associates ERwin - TUTORIALER Is* : <Mair> Subject Area> / Di鈍場(chǎng)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。這對(duì)范疇,ithin歐文允許我們區(qū)分識(shí)別和nonidentifying一對(duì)多的關(guān)系.OnetomanyRelationshipsWellbeginwithtworelationships,betweenInspectionandEmployeeandbetweenInspectionandProperty。我們可以先開(kāi)始兩個(gè)關(guān)系,檢驗(yàn)和員工之問(wèn),檢驗(yàn)和財(cái)產(chǎn)的權(quán)利之間Inspectionisrel

34、atedtobothPropertyandEmployee in one to many relationships同時(shí)與檢驗(yàn)是財(cái)產(chǎn)和員工在一對(duì)多的關(guān)系EachInspectionisundertakenatoneProperty;在進(jìn)行每個(gè)檢查是套房產(chǎn)eachPropertymayundergomanyinspections每處房產(chǎn),可能經(jīng)過(guò)許多檢查。EachInspectioniscarriedoutbyoneEmployee每次檢驗(yàn)進(jìn)行了一名員工;eachEmployeecarriesoutmanyInspections每一位員工進(jìn)行許多檢查.Aretheserelationshipsi

35、dentifyingrelationshipsornon-identifyingrelationships?這些是關(guān)系識(shí)別關(guān)系或nonidentifying關(guān)系嗎?Aretheserelationshipsidentifyingrelationshipsornonidentifyingrelationships?這些是關(guān)系識(shí)另關(guān)系或nonidentifying關(guān)系嗎?TheissuehingesonthenatureoftheprimarykeyofInspection,theentityonthe“manysideoftherelationship。問(wèn)題的關(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è)人可能會(huì)爭(zhēng)辯說(shuō)不管那是一種合理的假設(shè),但為了說(shuō)明我們可以假設(shè)它是.NoticethattheprimarykeyofInspectionincludestheprimarykeyofProperty,theentitywithwhichithasarelationship.值得注意的是,主鍵檢查包括主鍵的性質(zhì)、實(shí)體與它有關(guān)系Forthisreason,wesaythattherelationshipbetweenInspectionandPropertyisanidentifyingone

38、to-manyrelationship.因?yàn)檫@個(gè)原因,我們說(shuō),檢驗(yàn)和財(cái)產(chǎn)之間的關(guān)系是一種識(shí)別一對(duì)多的關(guān)系。Anidentifyingrelationshipiscreatedbyclickingfirstontheidentifyingrelationshipicon(").創(chuàng)建一個(gè)識(shí)別關(guān)系是通過(guò)點(diǎn)擊第一的在識(shí)別關(guān)系圖標(biāo)()Noticethatithasthecrow'sfootnotation(indicating"many")andasolidline(indicatingidentifying)。值得注意的是,它有烏鴉腳的符號(hào)(表示“許多”)和一個(gè)實(shí)

39、線(指著識(shí)別)Tocreateanidentifyingrelationship,clickfirstonthisicon,thenclickontheparententity(ontheonesideoftherelationship)andthenclickonthechildentity(onthemanysideoftherelationship)。倉(cāng)I建個(gè)識(shí)別關(guān)系,點(diǎn)擊先在這個(gè)圖標(biāo),然后點(diǎn)擊“家長(zhǎng)實(shí)體(在這邊的關(guān)系),然后點(diǎn)擊孩子實(shí)體(在許多一端的關(guān)系)Inthiscase,youwillclickfirstontheidentifyingrelationshipicon,theno

40、nProperty,thenonInspection.在這種情況下,你就會(huì)點(diǎn)擊圖標(biāo)先識(shí)別,然后在產(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è)對(duì)話框,以這種方式我們能夠進(jìn)一步提煉的關(guān)系的定義。FilloutthisdialogboxasshowninFigure11.填寫這對(duì)話框如圖11分Figure11:RelationshipsdefinitionIntheRelationship:textboxtherelationshipispresentedintheformparententityR/1childentity.在這段關(guān)系的關(guān)系:文本框的形式給出了R/1孩子家長(zhǎng)實(shí)體的實(shí)體The

42、VerbPhraseportionofthisboxallowsustodefinethelabeltoplaceontherelationshipinplaceofR/1.這個(gè)動(dòng)詞短語(yǔ)的一部分,這盒允許我們來(lái)定義標(biāo)簽的地方的關(guān)系上所處的R/1SincetheparententityisPropertyandtheChildentityisInspection,theParenttoChildverbphrasewillread“PropertyUndergoesInspection.”自從父母實(shí)體是財(cái)產(chǎn)和孩子的主體是檢查、Parent-toChild動(dòng)詞短語(yǔ)會(huì)讀”財(cái)產(chǎn)經(jīng)歷檢查."T

43、heChildtoParentverbphrasewillread”InspectionUndertakenatProperty。"動(dòng)詞短語(yǔ)的Child一to-Parent會(huì)讀”的檢測(cè)在進(jìn)行財(cái)產(chǎn)?!盜ntheRelationshipCardinalityportionofthiswindow,wecandeterminehowmanychildentityoccurencesmaybeassociatedwitheachparententityoccurence.人際關(guān)系的行集數(shù)的一部分,這窗戶,我們可以決定了有多少孩子實(shí)體檢測(cè)儀可伴有每個(gè)父母實(shí)體發(fā)生Morespecifically

44、,"OnePropertyUndergoesZero,OneorMoreInspections.”更具體地說(shuō),“一個(gè)財(cái)產(chǎn)經(jīng)歷零,一個(gè)或更多的檢查.”Noticethatatthispointwearealsoabletodefineparticipation.值得注意的是,在這一點(diǎn)上我們也能夠定義的參與。Ifeachpropertyhadtohaveundergoneatleastoneinspectioninordertobestoredinthedatabase,thenwecouldhaveforcedmandatoryparticipationbychoosingtheOne

45、orMoreoption。如果每個(gè)貝才產(chǎn)不得不經(jīng)歷了至少一個(gè)檢測(cè)為了被儲(chǔ)存在數(shù)據(jù)庫(kù)中,那么,我們就可以迫使強(qiáng)制性參與挑選一個(gè)或更多的選擇.ClickOKtocompletetherelationshipdefinition,asshowninFigure12。點(diǎn)擊OK完成關(guān)系定義,如圖12。Figure12:FinishedrelationshipNoticethatwhenanentityparticipatesasthechildinanidentifyingrelationshipitismodeledwithroundedcorners.值得注意的是,當(dāng)個(gè)實(shí)體作為識(shí)別的關(guān)系那孩子是模仿

46、和圓角。Thisnotationisusedforwhatinotherdatamodelingtoolsiscalleda”WeakEntity"。這個(gè)符號(hào)是用來(lái)在其他數(shù)據(jù)建模工具,一種被稱為“弱單位”。TherelationshipbetweenInspectionandEmployeeissomewhatdifferent。檢查和員工之間的關(guān)系是有不同的.Itisaone-tomanyrelationship,butitisnonidentifying,becausetheprimarykeyofEmployeeisnotpartoftheprimarykeyofInspect

47、ion.這是個(gè)對(duì)多的關(guān)系,但它是nonidentifying中的主鍵,因?yàn)楣蛦T沒(méi)有部分的主鍵檢查Forsucharelationship,wemustclickonthenonidentifyingrelationshipiconJ、(,),whichusesadashedlineinsteadofasolidline。對(duì)于這樣一個(gè)關(guān)系,我們必須點(diǎn)擊屏幕上的圖標(biāo)(:),它使用一個(gè)虛線來(lái)代替一個(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)系來(lái)定義窗口和關(guān)系把它填上如圖13歲。Figure 13 : Non-identifying relationship definitio

49、noAsbefore,weprovidemoremeaningfulverbphrasesfortherelationship.和以前一樣,我們提供更多的有意義的動(dòng)詞短語(yǔ)的關(guān)系A(chǔ)sbefore,sinceeachemployeemaybeassociatedwithzero,oneormoreinspections,wechoosethecorrespondingcardinality。和以前一樣,因?yàn)槊總€(gè)員工可能伴有零,一個(gè)或多個(gè)檢查,我們選擇相應(yīng)的行集數(shù)Unlikebefore,whenwechosetheidentifyingrelationshiptype,wehavenowchose

50、nthenonidentifyingrelationshiptype。不同于以往的,當(dāng)我們選擇了識(shí)別關(guān)系類型,我們現(xiàn)在已經(jīng)選好了nonidentifying關(guān)系類型.Wehavetheoptionofindicatingwhethernullsarepermittedornot。我們可以選擇是否允許nulls表示。Thisdecisionregardstheparticipationoftheparententityinarelationshipwiththechildentity。這一決定將參與實(shí)體的父母與孩子的關(guān)系實(shí)體。Inotherwords,doeseachchildentityocc

51、urence(Inspection)havetobeassociatedwithaparententityoccurence(Employee)?換句話說(shuō),每一個(gè)孩子的實(shí)體(檢查)發(fā)生有助于家長(zhǎng)實(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酉號(hào)so口dtE,ERwin-TUTORIALER1=*:<MainSubjectArea>/Display1引'FiteEditViewFormatModelModdP4arEToolsWindowHelpR6dyAcces?Figure14:NonidentifyingrelationshipEmployeeandOfficealsopart

55、icipationinarelationshipwitheachother。員工和辦公室也參與相互認(rèn)識(shí)EachEmployeeisassignedtooneandonlyoneOffice,andeachOfficehasoneormoreEmployees。每個(gè)員工被指定至U唯一的一間辦公室,每個(gè)辦公室都擁有一個(gè)或更多的員工。Inthisonetomanyrelationship,OfficeistheparentandEmployeeisthechild.在這一對(duì)多的關(guān)系,辦公室是家長(zhǎng)和員工是孩子。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)系,參與對(duì)雙方都是強(qiáng)制性的實(shí)體TheCardinalityindicatesthateachOfficeisassociatedwithOneorMore(butnotZero)Employees。每間辦公室的行集數(shù)表明,伴隨著一個(gè)或多個(gè)(但不是零)的雇員.TheRelationshipTypeindicatesthatthisisanon-identifyingrelationship,andthatNullsarenotpermitted.他的關(guān)系類型顯示,這是一個(gè)non-identifying關(guān)系,Nul

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論