只是将一些设置更改为学说实体配置并得到以下执行
The column id must be mapped to a field in class VSmart\OrmBundle\Entity\Ob
ject since it is referenced by a join column of another class.
我希望该列id
未映射到Object
. 不过,请参阅此处的特定映射的代码:
/**
* @var integer
*
* @ORM\Column(name="Id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
那么,真正想告诉我的例外是什么?
更新
这是关系的另一端。
对象定义:
/**
* @var integer
*
* @ORM\Column(name="Id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="Address", type="string", length=45, nullable=true)
*/
private $address;
/**
* @var string
*
* @ORM\Column(name="Name", type="string", length=45, nullable=true)
*/
private $name;
/**
* @var \Entis
*
* @ORM\ManyToOne(targetEntity="Entis",inversedBy="objects")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="EntisId", referencedColumnName="Id")
* })
*/
private $entis;
/**
* @var \Objecttype
*
* @ORM\ManyToOne(targetEntity="ObjectType")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="ObjectType", referencedColumnName="Id")
* })
*/
private $objectType;
/**
* @var \Unit
*
* @ORM\ManyToOne(targetEntity="Unit")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="UnitId", referencedColumnName="Id")
* })
*/
private $unit;
/**
* @var \Dimension
*
* @ORM\ManyToOne(targetEntity="Dimension")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="DimensionId", referencedColumnName="Id")
* })
*/
private $dimension;
/**
* @ORM\ManyToMany(targetEntity="Tag") */
private $tags;
/**
* @ORM\OneToMany(targetEntity="Measurement", mappedBy="object")
*/
private $measurements;