首页 新闻 会员 周边 捐助

Office Account 2008 中的ORM框架问题

0
悬赏园豆:20 [已关闭问题]
<p class="MsoNormal"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CZengYong%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:SpaceForUL/> <w:BalanceSingleByteDoubleByteWidth/> <w:DoNotLeaveBackslashAlone/> <w:ULTrailSpace/> <w:DoNotExpandShiftReturn/> <w:AdjustLineHeightInTable/> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:UseFELayout/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><style> <!-- /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:"\@宋体"; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; mso-pagination:none; font-size:10.5pt; mso-bidi-font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:宋体; mso-font-kerning:1.0pt;} /* Page Definitions */ @page {mso-page-border-surround-header:no; mso-page-border-surround-footer:no;} @page Section1 {size:595.3pt 841.9pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:42.55pt; mso-footer-margin:49.6pt; mso-paper-source:0; layout-grid:15.6pt;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><p class="MsoNormal"><span lang="EN-US"><o:p>请问如何利用实体对象和关系建立SchemaGraph,然后生成数据库DDL。</o:p></span></p><p class="MsoNormal"><span lang="EN-US"><o:p><br></o:p></span></p><p class="MsoNormal"><span style="font-family: 宋体;">映射属性元编程实现</span><span lang="EN-US">Attribute2DDL</span></p> <p class="MsoNormal"><span style="font-family: 宋体;">微软利用实体对象</span><span lang="EN-US">Entity</span><span style="font-family: 宋体;">的</span><span lang="EN-US">attribute</span><span style="font-family: 宋体;">属性、类的继承关系和外键关系生成</span><span lang="EN-US">SchemaGraph</span><span style="font-family: 宋体;">,然后再在数据库中创建相应的数据表</span><span lang="EN-US">Table</span><span style="font-family: 宋体;">,数据视图</span><span lang="EN-US">View</span><span style="font-family: 宋体;">和</span><span lang="EN-US">StoredProcedure</span><span style="font-family: 宋体;">。也就是通过这个</span><span lang="EN-US">ORM</span><span style="font-family: 宋体;">框架实现了</span><span lang="EN-US">Entity-</span><span style="font-family: 宋体;">》</span><span lang="EN-US">DataBase Schema</span><span style="font-family: 宋体;">的方式,和其他的</span><span lang="EN-US">ORM</span><span style="font-family: 宋体;">框架从</span><span lang="EN-US">DataBase Schema</span><span style="font-family: 宋体;">生成实体</span><span lang="EN-US">Entity</span><span style="font-family: 宋体;">的方式相反。</span></p> <p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal"><span style="font-family: 宋体;">个人认为这种才是完全基于面向对象</span><span lang="EN-US">OO</span><span style="font-family: 宋体;">的</span><span lang="EN-US">ORM</span><span style="font-family: 宋体;">框架。</span></p> <p class="MsoNormal"><span style="font-family: 宋体;">可惜本人的数据结构</span><span lang="EN-US">Graph</span><span style="font-family: 宋体;">学得不好,不能看懂它其中由</span><span lang="EN-US">Entity</span><span style="font-family: 宋体;">和</span><span lang="EN-US">Entity Relation</span><span style="font-family: 宋体;">建立的</span><span lang="EN-US">SchemaGraph</span><span style="font-family: 宋体;">的代码。</span></p> <p class="MsoNormal"><span lang="EN-US">SchemaGraph</span><span style="font-family: 宋体;">中含有</span><span lang="EN-US">Vertex</span><span style="font-family: 宋体;">,</span><span lang="EN-US">Edge</span><span style="font-family: 宋体;">的定义。可能是通过</span><span lang="EN-US">Graph</span><span style="font-family: 宋体;">的周游建立了</span><span lang="EN-US">SchemaGraph</span><span style="font-family: 宋体;">,由于</span><span lang="EN-US">OfficeAccount</span><span style="font-family: 宋体;">没有这个过程的代码,所以比较难懂。在软件的代码中只定义了软件数据库</span><span lang="EN-US">Schema</span><span style="font-family: 宋体;">升级的代码。</span></p> <p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal"><span style="font-family: 宋体;">大家在</span><span lang="EN-US">Entity</span><span style="font-family: 宋体;">和</span><span lang="EN-US">Entity Relation</span><span style="font-family: 宋体;">建立的</span><span lang="EN-US">SchemaGraph</span><span style="font-family: 宋体;">方面有什么好的建议吗</span></p><p class="MsoNormal"><br><span style="font-family: 宋体;"></span></p><p class="MsoNormal"><span style="font-family: 宋体;">具体文章见http://www.cnblogs.com/zengyongjoy/archive/2008/06/24/1228654.html<br></span></p> <p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p><br><span style="font-family: 宋体;"></span></p>
richardzeng的主页 richardzeng | 初学一级 | 园豆:180
提问于:2008-06-24 10:00
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册