Discussion:
[doctrine-user] Embeddable asking for class.orm.xml mapping
j***@ofertix.com
2016-04-07 08:48:13 UTC
Permalink
When I do a doctrine:migrations:diff on Symfony 2.8 Doctrine throws this
Mapping Exception:

[Doctrine\Common\Persistence\Mapping\MappingException] No mapping file
found named 'NameVO.orm.xml' for class
'Component\Customer\Domain\Model\NameVO'.

I can't figure out what's wrong with my mapping.

Here it is my mapping file for the Entity containing the embeddable:

<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-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="Component\Customer\Domain\Model\Customer" table="customer"
repository-class="GAT\CustomerBundle\Infrastructure\DoctrineCustomerRepository">
<id name="id" type="string" column="id" length="36">
<generator strategy="UUID"/>
</id>
<field name="email" type="string" column="email" length="255" nullable="false"/>
<field name="store" type="smallint" column="store" length="1" nullable="false"/>
<field name="type" type="smallint" column="type" length="1" nullable="false"/>
<field name="password" type="string" column="password" length="60" nullable="true"/>
<field name="status" type="smallint" column="status" length="1" nullable="false"/>
<field name="legalId" type="string" column="legal_id" length="24" nullable="true"/>
<field name="gender" type="string" column="gender" length="1" nullable="true"/>
<field name="birthdate" type="date" column="birthdate" nullable="true"/>
<field name="telephone" type="string" column="telephone" length="24" nullable="true"/>
<field name="zipcode" type="string" column="zipcode" length="5" nullable="true"/>
<field name="creationChannel" type="string" column="creation_channel" length="2" nullable="false"/>
<field name="marketingLead" type="string" column="marketing_lead" length="255" nullable="true"/>
<embedded name="name" class="Component\Customer\Domain\Model\NameVO" use-column-prefix="false"/>
</entity>
<embeddable name="Component\Customer\Domain\Model\NameVO">
<field name="firstName" type="string" column="first_name" nullable="true"/>
<field name="lastName" type="string" column="last_name" nullable="true"/>
</embeddable>
</doctrine-mapping>



Thanks for any help you can provide.
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doctrine-user+***@googlegroups.com.
To post to this group, send email to doctrine-***@googlegroups.com.
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
Marco Pivetta
2016-04-07 09:05:30 UTC
Permalink
The embeddable should have its own mapping file

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/
Post by j***@ofertix.com
When I do a doctrine:migrations:diff on Symfony 2.8 Doctrine throws this
[Doctrine\Common\Persistence\Mapping\MappingException] No mapping file
found named 'NameVO.orm.xml' for class
'Component\Customer\Domain\Model\NameVO'.
I can't figure out what's wrong with my mapping.
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-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="Component\Customer\Domain\Model\Customer" table="customer"
repository-class="GAT\CustomerBundle\Infrastructure\DoctrineCustomerRepository">
<id name="id" type="string" column="id" length="36">
<generator strategy="UUID"/>
</id>
<field name="email" type="string" column="email" length="255" nullable="false"/>
<field name="store" type="smallint" column="store" length="1" nullable="false"/>
<field name="type" type="smallint" column="type" length="1" nullable="false"/>
<field name="password" type="string" column="password" length="60" nullable="true"/>
<field name="status" type="smallint" column="status" length="1" nullable="false"/>
<field name="legalId" type="string" column="legal_id" length="24" nullable="true"/>
<field name="gender" type="string" column="gender" length="1" nullable="true"/>
<field name="birthdate" type="date" column="birthdate" nullable="true"/>
<field name="telephone" type="string" column="telephone" length="24" nullable="true"/>
<field name="zipcode" type="string" column="zipcode" length="5" nullable="true"/>
<field name="creationChannel" type="string" column="creation_channel" length="2" nullable="false"/>
<field name="marketingLead" type="string" column="marketing_lead" length="255" nullable="true"/>
<embedded name="name" class="Component\Customer\Domain\Model\NameVO" use-column-prefix="false"/>
</entity>
<embeddable name="Component\Customer\Domain\Model\NameVO">
<field name="firstName" type="string" column="first_name" nullable="true"/>
<field name="lastName" type="string" column="last_name" nullable="true"/>
</embeddable>
</doctrine-mapping>
Thanks for any help you can provide.
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doctrine-user+***@googlegroups.com.
To post to this group, send email to doctrine-***@googlegroups.com.
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
Juan Angosto
2016-04-07 09:31:43 UTC
Permalink
Thanks Marco,

I tried it before but declaring it as an entity.
Post by Marco Pivetta
The embeddable should have its own mapping file
Marco Pivetta
http://twitter.com/Ocramius <http://twitter.com/Ocramius>
http://ocramius.github.com/ <http://ocramius.github.com/>
[Doctrine\Common\Persistence\Mapping\MappingException] No mapping file found named 'NameVO.orm.xml' for class 'Component\Customer\Domain\Model\NameVO'.
I can't figure out what's wrong with my mapping.
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping <http://doctrine-project.org/schemas/orm/doctrine-mapping>" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance <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> http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd <http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd>">
<entity name="Component\Customer\Domain\Model\Customer" table="customer"
repository-class="GAT\CustomerBundle\Infrastructure\DoctrineCustomerRepository">
<id name="id" type="string" column="id" length="36">
<generator strategy="UUID"/>
</id>
<field name="email" type="string" column="email" length="255" nullable="false"/>
<field name="store" type="smallint" column="store" length="1" nullable="false"/>
<field name="type" type="smallint" column="type" length="1" nullable="false"/>
<field name="password" type="string" column="password" length="60" nullable="true"/>
<field name="status" type="smallint" column="status" length="1" nullable="false"/>
<field name="legalId" type="string" column="legal_id" length="24" nullable="true"/>
<field name="gender" type="string" column="gender" length="1" nullable="true"/>
<field name="birthdate" type="date" column="birthdate" nullable="true"/>
<field name="telephone" type="string" column="telephone" length="24" nullable="true"/>
<field name="zipcode" type="string" column="zipcode" length="5" nullable="true"/>
<field name="creationChannel" type="string" column="creation_channel" length="2" nullable="false"/>
<field name="marketingLead" type="string" column="marketing_lead" length="255" nullable="true"/>
<embedded name="name" class="Component\Customer\Domain\Model\NameVO" use-column-prefix="false"/>
</entity>
<embeddable name="Component\Customer\Domain\Model\NameVO">
<field name="firstName" type="string" column="first_name" nullable="true"/>
<field name="lastName" type="string" column="last_name" nullable="true"/>
</embeddable>
</doctrine-mapping>
Thanks for any help you can provide.
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
Visit this group at https://groups.google.com/group/doctrine-user <https://groups.google.com/group/doctrine-user>.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to a topic in the Google Groups "doctrine-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/doctrine-user/MtYpDFf2r4s/unsubscribe <https://groups.google.com/d/topic/doctrine-user/MtYpDFf2r4s/unsubscribe>.
Visit this group at https://groups.google.com/group/doctrine-user <https://groups.google.com/group/doctrine-user>.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doctrine-user+***@googlegroups.com.
To post to this group, send email to doctrine-***@googlegroups.com.
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
Loading...