I do not believe to be 4 days to solve this :/.
keep getting an exception:
AnnotationException: [Semantical Error] The annotation "@OneToOne" in
property Rangos\Entity\User::$userIdentity was never imported. Did you
maybe forget to add a "use" statement for this annotation?
My class are so.
namespace Rangos\Entity;
use Rangos\Entity\UserIdentity;
use Doctrine\ORM\Mapping as ORM;
/**
* User
*
* @ORM\Table(name="USUARIOS")
* @ORM\Entity
* @ORM\Entity(repositoryClass="Rangos\Entity\UserRepository")
*/
class User {
/**
* @var integer $userId
*
* @ORM\Column(name="USER_ID", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $userId;
/**
* @OneToOne(targetEntity="Rangos\Entity\UserIdentity")
* @JoinColumn(name="userIdentity", referencedColumnName="USER_I_USER")
* */
private $userIdentity;
/**
* @var integer $userEmp
*
* @ORM\Column(name="USER_EMP", type="integer", nullable=false)
*/
private $userEmp;
}
namespace Rangos\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* UserIdentity
*
* @ORM\Table(name="USUARIOS_IDENTIDADE")
* @ORM\Entity
* @ORM\Entity(repositoryClass="Rangos\Entity\UserIdentityRepository")
*/
class UserIdentity {
/**
* @var integer $userIId
*
* @ORM\Column(name="USER_I_ID", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $userIId;
/**
* @var \USUARIOS
* @ORM\GeneratedValue
* @ORM\OneToOne(targetEntity="Rangos\Entity\User" ,
inversedBy="userIdentity")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="USER_I_USER",
referencedColumnName="userIdentity")
* @ORM\JoinColumn(name="USER_I_USER", referencedColumnName="USER_ID")
* })
*/
private $userIUser;
/**
* @var string $userINome
*
* @ORM\Column(name="USER_I_NOME", type="string", length=40,
nullable=false)
*/
private $userINome;
}
Em quarta-feira, 26 de fevereiro de 2014 15h48min31s UTC-3, Herman Peeren
escreveu:
>
> On Wednesday, 26 February 2014 19:11:15 UTC+1, João Carlos Santa Ana wrote:
>>
>> Ok, Herman. Tank's for the reply . I'm changed tables its as
>> recommentations.
>> To be Able to Call from User tables Supplementary Which Annotation need
>> put an User and Supplementary Tables. could give um Small Example.
>>
>
> No need to change tables. Just the entities and the mapping. See
> documentation:
>
> http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/association-mapping.html#one-to-one-bidirectional
>
> Your Usario is like the Customer in that example; your Endereco and
> Identidade are like the Cart in that example.
>
> If you want to "call tables" then why would you use an ORM?
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/groups/opt_out.