From 9983fcbac39960117773376fe94c85a328351479 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Tue, 10 Sep 2013 23:15:43 +0200 Subject: [PATCH] Fix some more details in basic-mapping.rst --- docs/en/reference/basic-mapping.rst | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/en/reference/basic-mapping.rst b/docs/en/reference/basic-mapping.rst index b8ded9338..c2b3aaa61 100644 --- a/docs/en/reference/basic-mapping.rst +++ b/docs/en/reference/basic-mapping.rst @@ -368,30 +368,31 @@ besides specifying the sequence's name: .. code-block:: php - + - + .. code-block:: yaml - MyPersistentClass: + Message: type: entity id: id: @@ -399,7 +400,7 @@ besides specifying the sequence's name: generator: strategy: SEQUENCE sequenceGenerator: - sequenceName: tablename_seq + sequenceName: message_seq allocationSize: 100 initialValue: 1 @@ -439,15 +440,14 @@ need to access the sequence once to generate the identifiers for Composite Keys ~~~~~~~~~~~~~~ -Doctrine 2 allows to use composite primary keys. There are however -some restrictions opposed to using a single identifier. The use of -the ``@GeneratedValue`` annotation is only supported for simple -(not composite) primary keys, which means you can only use -composite keys if you generate the primary key values yourself -before calling ``EntityManager#persist()`` on the entity. +with Doctrine 2 you can use composite primary keys, using ``@Id`` on more then +one column. Some restrictions exist opposed to using a single identifier in +this case: The use of the ``@GeneratedValue`` annotation is not supported, +which means you can only use composite keys if you generate the primary key +values yourself before calling ``EntityManager#persist()`` on the entity. -To designate a composite primary key / identifier, simply put the -@Id marker annotation on all fields that make up the primary key. +More details on composite primary keys are discussed in a :doc:`dedicated tutorial +<../tutorials/composite-primary-keys>`. Quoting Reserved Words ----------------------