2009-06-01 16:14:11 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
2009-08-13 10:13:06 +00:00
|
|
|
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
|
2009-06-01 16:14:11 +00:00
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
2009-08-13 10:13:06 +00:00
|
|
|
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
|
2009-12-16 13:47:59 +00:00
|
|
|
http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
|
2012-12-16 12:57:53 +01:00
|
|
|
|
2009-08-13 11:03:26 +00:00
|
|
|
<entity name="Doctrine\Tests\ORM\Mapping\User" table="cms_users">
|
2012-01-26 14:36:56 +01:00
|
|
|
<options>
|
|
|
|
<option name="foo">bar</option>
|
|
|
|
<option name="baz">
|
|
|
|
<option name="key">val</option>
|
|
|
|
</option>
|
|
|
|
</options>
|
2010-04-28 20:27:53 +02:00
|
|
|
|
2010-06-13 22:59:56 +02:00
|
|
|
<indexes>
|
|
|
|
<index name="name_idx" columns="name"/>
|
|
|
|
<index columns="user_email"/>
|
|
|
|
</indexes>
|
|
|
|
|
2010-04-28 20:27:53 +02:00
|
|
|
<unique-constraints>
|
|
|
|
<unique-constraint columns="name,user_email" name="search_idx" />
|
|
|
|
</unique-constraints>
|
2012-01-26 14:36:56 +01:00
|
|
|
|
2009-08-25 09:14:08 +00:00
|
|
|
<lifecycle-callbacks>
|
|
|
|
<lifecycle-callback type="prePersist" method="doStuffOnPrePersist"/>
|
2010-03-15 19:29:07 +00:00
|
|
|
<lifecycle-callback type="prePersist" method="doOtherStuffOnPrePersistToo"/>
|
2009-08-25 09:14:08 +00:00
|
|
|
<lifecycle-callback type="postPersist" method="doStuffOnPostPersist"/>
|
|
|
|
</lifecycle-callbacks>
|
2009-08-24 21:05:55 +00:00
|
|
|
|
2011-03-06 18:45:09 -03:00
|
|
|
<named-queries>
|
|
|
|
<named-query name="all" query="SELECT u FROM __CLASS__ u"/>
|
|
|
|
</named-queries>
|
|
|
|
|
2009-06-01 16:14:11 +00:00
|
|
|
<id name="id" type="integer" column="id">
|
2009-12-16 13:47:59 +00:00
|
|
|
<generator strategy="AUTO"/>
|
2010-06-13 17:21:14 +02:00
|
|
|
<sequence-generator sequence-name="tablename_seq" allocation-size="100" initial-value="1" />
|
2009-06-01 16:14:11 +00:00
|
|
|
</id>
|
2012-12-16 12:57:53 +01:00
|
|
|
|
2012-01-27 11:05:47 +01:00
|
|
|
<field name="name" column="name" type="string" length="50" nullable="true" unique="true">
|
|
|
|
<options>
|
|
|
|
<option name="foo">bar</option>
|
|
|
|
<option name="baz">
|
|
|
|
<option name="key">val</option>
|
|
|
|
</option>
|
|
|
|
</options>
|
|
|
|
</field>
|
2010-02-01 21:48:27 +00:00
|
|
|
<field name="email" column="user_email" type="string" column-definition="CHAR(32) NOT NULL" />
|
2012-12-16 12:57:53 +01:00
|
|
|
|
|
|
|
<field name="version" type="integer" version="true" />
|
|
|
|
|
2010-04-10 00:00:36 +02:00
|
|
|
<one-to-one field="address" target-entity="Address" inversed-by="user">
|
2010-02-09 17:13:49 +00:00
|
|
|
<cascade><cascade-remove /></cascade>
|
2010-03-17 14:20:18 +00:00
|
|
|
<join-column name="address_id" referenced-column-name="id" on-delete="CASCADE" on-update="CASCADE"/>
|
2009-06-01 16:14:11 +00:00
|
|
|
</one-to-one>
|
2012-12-16 12:57:53 +01:00
|
|
|
|
2011-08-16 11:36:41 -03:00
|
|
|
<one-to-many field="phonenumbers" target-entity="Phonenumber" mapped-by="user" index-by="number" orphan-removal="true">
|
2009-06-01 16:14:11 +00:00
|
|
|
<cascade>
|
2009-07-25 16:33:29 +00:00
|
|
|
<cascade-persist/>
|
2009-06-01 16:14:11 +00:00
|
|
|
</cascade>
|
2010-06-13 17:21:14 +02:00
|
|
|
<order-by>
|
|
|
|
<order-by-field name="number" direction="ASC" />
|
|
|
|
</order-by>
|
2009-06-01 16:14:11 +00:00
|
|
|
</one-to-many>
|
2012-12-16 12:57:53 +01:00
|
|
|
|
2009-08-21 18:13:22 +00:00
|
|
|
<many-to-many field="groups" target-entity="Group">
|
2010-02-09 17:13:49 +00:00
|
|
|
<cascade>
|
|
|
|
<cascade-all/>
|
|
|
|
</cascade>
|
2009-06-01 16:14:11 +00:00
|
|
|
<join-table name="cms_users_groups">
|
|
|
|
<join-columns>
|
2010-01-27 23:00:55 +00:00
|
|
|
<join-column name="user_id" referenced-column-name="id" nullable="false" unique="false" />
|
2009-06-01 16:14:11 +00:00
|
|
|
</join-columns>
|
|
|
|
<inverse-join-columns>
|
2010-02-01 21:48:27 +00:00
|
|
|
<join-column name="group_id" referenced-column-name="id" column-definition="INT NULL" />
|
2009-06-01 16:14:11 +00:00
|
|
|
</inverse-join-columns>
|
|
|
|
</join-table>
|
|
|
|
</many-to-many>
|
2012-12-16 12:57:53 +01:00
|
|
|
|
2009-06-01 16:14:11 +00:00
|
|
|
</entity>
|
|
|
|
|
2010-01-22 15:10:13 +00:00
|
|
|
</doctrine-mapping>
|