|
4119 - trunk/PersistentObject/docs [eZComponents: Trunk]: msg#00292web.ezcomponents.cvs
Author: Tobias Schlitt Date: 2006-11-28 19:55:07 +0100 (Tue, 28 Nov 2006) New Revision: 4119 Log: - Added a section about ezcPersistentNativeGenerator. Modified: trunk/PersistentObject/docs/tutorial.txt Modified: trunk/PersistentObject/docs/tutorial.txt =================================================================== --- trunk/PersistentObject/docs/tutorial.txt 2006-11-28 18:43:28 UTC (rev 4118) +++ trunk/PersistentObject/docs/tutorial.txt 2006-11-28 18:55:07 UTC (rev 4119) @@ -305,8 +305,8 @@ The sequence generator relies on the PDO::lastInsertId() method to retrieve the IDs for newly created persistent objects. -It is recommended to use auto_increment id columns for databases supporting -it. This includes MySQL and SQLite. Other databases need to use a sequence. E.g +For databases supporting auto_increment (like MySQL and SQLite) the usage of +ezcPersistentNativeGenerator. Other databases need to use a sequence. E.g for PostgreSQL the person table definition should look like: :: CREATE TABLE persons @@ -328,6 +328,28 @@ ); ?> +ezcPersistentNativeGenerator +---------------------------- + +The native generator relies on auto_increment, which is supported by e.g. MySQL +and SQLite. A table definition for this looks like that: :: + + CREATE TABLE persons + ( + id integer unsigned not null auto_increment, + full_name varchar(255), + age integer, + PRIMARY KEY (id) + ); + +The according generator definition: :: + + <?php + $def->idProperty->generator = new ezcPersistentGeneratorDefinition( + 'ezcPersistentNativeGenerator' + ); + ?> + ezcPersistentManualGenerator ---------------------------- |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | 4118 - trunk/PersistentObject/docs [eZComponents: Trunk]: 00292, Tobias Schlitt |
|---|---|
| Next by Date: | 4120 - in trunk/Template: src/parsers/source_to_tst/implementations tests/regression_tests/blocks/incorrect [eZComponents: Trunk]: 00292, Jan Borsodi |
| Previous by Thread: | 4118 - trunk/PersistentObject/docs [eZComponents: Trunk]i: 00292, Tobias Schlitt |
| Next by Thread: | 4120 - in trunk/Template: src/parsers/source_to_tst/implementations tests/regression_tests/blocks/incorrect [eZComponents: Trunk]: 00292, Jan Borsodi |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |