|
295.
|
|
|
rowKeyColumns - list of key columns in form: <code>[(columnName, typeName)]</code>
|
|
|
type: Content of: <html><body><ul><li>
|
|
|
|
rowKeyColumns ——主键,也是类似的 tuple-list 格式:<code>[(列名, 类型)]</code>
|
|
Translated by
Fantix King
|
|
Reviewed by
Fantix King
|
|
|
|
Located in
howto/row.xhtml:59
|
|
296.
|
|
|
rowTableName - the name of the database table
|
|
|
type: Content of: <html><body><ul><li>
|
|
|
|
rowTableName ——数据库表的名称
|
|
Translated by
Fantix King
|
|
Reviewed by
Fantix King
|
|
|
|
Located in
howto/row.xhtml:61
|
|
297.
|
|
|
There are also two optional class attributes that can be specified:
|
|
|
type: Content of: <html><body><p>
|
|
|
|
下面两个类属性是可选的:
|
|
Translated by
Fantix King
|
|
Reviewed by
Fantix King
|
|
|
|
Located in
howto/row.xhtml:64
|
|
298.
|
|
|
rowForeignKeys - list of foreign keys to other database tables in the form: <code>[(tableName, [(childColumnName, childColumnType), ...], [(parentColumnName, parentColumnType), ...], containerMethodName, autoLoad]</code>
|
|
|
type: Content of: <html><body><ul><li>
|
|
|
|
rowForeignKeys —— 外键的列表,格式为:<code>[(表名, [(子列名, 子列类型), ...], [(父列名, 父列类型), ...], 容器方法名, 是否自动加载]</code>(其中“容器方法”是加载父行对象——也就是这里说的容器——的时候用的——译者注)
|
|
Translated by
Fantix King
|
|
Reviewed by
Fantix King
|
|
|
|
Located in
howto/row.xhtml:67
|
|
299.
|
|
|
rowFactoryMethod - a method that creates instances of this class
|
|
|
type: Content of: <html><body><ul><li>
|
|
|
|
rowFactoryMethod ——创建自身类(应该就是 row.RowObject 的子类——译者注)实例的工厂方法
|
|
Translated by
Fantix King
|
|
Reviewed by
Fantix King
|
|
|
|
Located in
howto/row.xhtml:70
|
|
300.
|
|
|
For example:
|
|
|
type: Content of: <html><body><p>
|
|
|
|
例如:
|
|
Translated by
Kevin
|
|
Reviewed by
Fantix King
|
|
|
|
Located in
howto/row.xhtml:74
|
|
301.
|
|
|
class RoomRow(row.RowObject):
rowColumns = [("roomId", "int"),
("town_id", "int"),
("name", "varchar"),
("owner", "varchar"),
("posx", "int"),
("posy", "int"),
("width", "int"),
("height", "int")]
rowKeyColumns = [("roomId", "int4")]
rowTableName = "testrooms"
rowFactoryMethod = [testRoomFactory]
|
|
|
type: Content of: <html><body><pre>
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
represents a space character.
Enter a space in the equivalent position in the translation.
|
|
|
|
class RoomRow(row.RowObject):
rowColumns = [("roomId", "int"),
("town_id", "int"),
("name", "varchar"),
("owner", "varchar"),
("posx", "int"),
("posy", "int"),
("width", "int"),
("height", "int")]
rowKeyColumns = [("roomId", "int4")]
rowTableName = "testrooms"
rowFactoryMethod = [testRoomFactory]
|
|
Translated and reviewed by
Fantix King
|
|
|
|
Located in
howto/row.xhtml:77
|
|
302.
|
|
|
The items in the rowColumns list will become data members of classes of this type when they are created by the Reflector.
|
|
|
type: Content of: <html><body><p>
|
|
|
|
当我们使用 Reflector 创建该类时,所有在列名列表(rowColumns)中的各项将会成为该类的一个数据成员(data members)。
|
|
Translated by
Kevin
|
|
Reviewed by
Fantix King
|
|
|
|
Located in
howto/row.xhtml:91
|
|
303.
|
|
|
Initialization
|
|
|
type: Content of: <html><body><h2>
|
|
|
|
初始化
|
|
Translated and reviewed by
Kevin
|
|
|
|
Located in
howto/row.xhtml:94
|
|
304.
|
|
|
The initialization phase builds the SQL for the database interactions. It uses the system catalogs of the database to do this, but requires some basic information to get started. The class attributes of the classes derived from RowClass are used for this. Those classes are passed to a Reflector when it is created.
|
|
|
type: Content of: <html><body><p>
|
|
|
|
在初始化的阶段,会建立一些 SQL 操作来和数据库进行互交。她使用到了数据库的系统目录,同时需要的还有另外一些基本信息。派生自 RowClass 的子类的类属性的作用便是提供这些信息。这些子类在创建的时候会被传入一个Reflector进行处理。
|
|
Translated by
Kevin
|
|
Reviewed by
Fantix King
|
|
|
|
Located in
howto/row.xhtml:96
|