【发布时间】:2014-06-30 18:49:40
【问题描述】:
我正在从事一个通过 XML 进行实体映射的项目。所以这就是我的实体的样子:
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="Device\DeviceBundle\Entity\Device" table="device">
<id name="id" type="integer" column="id">
<generator strategy="AUTO" />
</id>
<field name="description" column="description" type="string" length="255" unique="true" nullable="false" />
<field name="imei" column="imei" type="string" length="17" unique="true" nullable="false" />
<field name="created" type="datetime">
<gedmo:timestampable on="create"/>
</field>
<field name="modified" type="datetime">
<gedmo:timestampable on="update"/>
</field>
<field name="deletedAt" type="datetime" nullable="true" />
<gedmo:soft-deleteable field-name="deletedAt" time-aware="false" />
</entity>
</doctrine-mapping>
当我从 Symfony2 控制台运行命令 doctrine:schema:validate 时,我得到以下输出:
[Doctrine\Common\Persistence\Mapping\MappingException]
'TaxiBooking\Device\DeviceBundle\Entity\Device' 类不存在
是的,没错,文件不存在,但我应该创建这个文件还是我错过了 XML 映射中的某些内容?有什么帮助吗?
【问题讨论】:
标签: xml symfony doctrine-orm mapping