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