Symfony / Doctrine materializedPath 问题

问题描述

我遵循了文档:

https://github.com/Atlantic18/DoctrineExtensions/blob/v2.4.x/doc/tree.md#materialized-path

我收到以下错误

 An exception occurred while executing 'UPDATE task SET path = ?,task_id = ?,lvl = ? WHERE id = ?' with params ["-1","-1",1]:  
                                                                                                                                       
  sqlSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'task_id' at row 1     

这是我的实体:

<?PHP

namespace App\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;

/**
 * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\MaterializedpathRepository")
 * @Gedmo\Tree(type="materializedpath")
 */
class Task
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer",options={"unsigned":true})
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORM\Column(type="string",length=128,nullable=false)
     */
    private $title;

    /**
     * @ORM\Column(type="integer",nullable=true)
     * @Gedmo\TreeLevel
     */
    private $lvl;

    /**
     * @ORM\Column(type="integer",nullable=true)
     * @Gedmo\TreeLeft
     */
    private $lft;

    /**
     * @ORM\Column(type="integer",nullable=true)
     * @Gedmo\TreeRight
     */
    private $rgt;

    /**
     * @ORM\Column(type="string",nullable=true)
     * @Gedmo\TreePath(separator=".",startsWithSeparator=false,endsWithSeparator=false)
     */
    private $path;

    /**
     * @ORM\Column(type="string",nullable=true)
     * @Gedmo\TreePathSource
     */
    private $source;

    /**
     * @ORM\OnetoMany(targetEntity="App\Entity\Task",mappedBy="parent")
     * @ORM\OrderBy({"lft":"ASC"})
     */
    private $children;

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Task")
     * @ORM\JoinColumn(name="task_id",referencedColumnName="id",onDelete="CASCADE")
     * @Gedmo\TreeRoot
     */
    private $root;

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Task",inversedBy="children")
     * @ORM\JoinColumn(name="parent_id",onDelete="CASCADE")
     * @Gedmo\TreeParent
     */
    private $parent;

}

我对物化路径的配置有什么不理解或遗漏了什么?

为什么节点 ID 也会出现负数???很奇怪...

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...