SQLdb Programming Reference/zh CN

From Lazarus wiki
Revision as of 09:35, 23 October 2011 by Lioncn (talk | contribs) (第一段最后那个复杂的句子我也搞不明白,只能按自己的理解去翻译。)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

类结构(Class Structure)

下图仅是说明 SQLDB 页面所涉及的主要组件的继承关系和彼此关系的一个尝试。这当然不能面面俱到,甚至也没有使用任何“合理”的图结构,所以不要期望太高,不会很深入的内容。只希望它能帮助你理解源代码更容易一点,尤其是想借助源代码搞明白在幕后真正发生了什么的时候。

(原文:The following diagram attempts to show the hierarchy and required links of the MAIN components involved in SQLdb. It is certainly not exhaustive, nor does it use any "proper" diagram structure, so please don't try to read too much into it. I hope it will make it easier to work out which bits of the source code you need to look at to really work out what is happening.) Laz SqlDB components.png

注释(Notes)

  • The link from TDatabase to TTransaction is Transactions, and is a list, implying many transactions are possible for the one database. However, a new link is defined from TSQLConnection to TSQLTransaction which is Transaction - a single transaction per database. This does not actually hide the previous link, but only the new link is published, and it is probably inadvisable to use the ancestor's link.
  • Some of the inherited links need to be typecast to the new types to be useful. You can't call SQLQuery.Transaction.Commit, as Commit is only defined in TSQLTransaction. Call SQLTransaction.Commit, or "with SQLQuery.Transaction as TSQLTransaction do commit"

(这仅仅是页面内容的开始,请扩充修改页面内容)

(原文:This is only the beginning of this page ...)