Symfony2存储库错误中的语义错误?

时间:2016-04-12 02:13:12

标签: php mysql symfony

我的代码出错,我用它说:

  

[语义错误]第0行,第347行附近'b   ':错误:Class Matrix \ MatrixEdiBundle \ Entity \ EdiTransaction没有名为ediTransactionId的关联

我是Symfony的新手,我想知道这里的错误在哪里,这是我的代码:

public function getDetails($gsNumber, $senderId, $receiverId,$page = 1, $limit = 5 ){
              $em = $this->getEntityManager();
              $query = $em->createQuery(
                      'SELECT partial a.{ediTransactionId, senderId, receiverId, gsNumber, fileName, isaNumber, transactionDate},
                       partial b.{edi997DetailId, noOfTrans},
                       partial c.{errorCodeId, errorCode, condition}

                       FROM MatrixEdiBundle:EdiTransaction a
                       JOIN a.edi997DetailId b
                       JOIN b.errorCodeId c
                       WHERE a.flag = 1
                       AND c.erroCodeId != 1
                       AND a.senderId LIKE :senderId
                       AND a.receiverId LIKE :receiverId
                       AND a.gsNumber LIKE :gsNumber
                       ');

                      ->setParameter('senderId', "%$senderId%")

                      ->setParameter('receiverId', "%$receiverId%")

                      ->setParameter('gsNumber', "%$gsNumber%")

                      ->setFirstResult(($page-1)*$limit)

                      ->setMaxResults($limit);



                      $paginator = new Paginator($query, $fetchJoinCollection = false );

                      $paginator->setUseOutputWalkers(false);


              return $paginator;
      }
}

这是我的EdiTransactions实体:

 <?php

namespace Matrix\MatrixEdiBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * EdiTransaction
 *
 * @ORM\Table(name="edi_transaction", indexes={@ORM\Index(name="edi_doc_type_id", columns={"edi_doc_type_id"})})
 * @ORM\Entity(repositoryClass="Matrix\MatrixEdiBundle\Repository\EdiTransactionRepository")
 */
class EdiTransaction
{
    /**
     * @var string
     *
     * @ORM\Column(name="sender_id", type="string", length=30, nullable=false)
     */
    private $senderId;

    /**
     * @var string
     *
     * @ORM\Column(name="receiver_id", type="string", length=30, nullable=false)
     */
    private $receiverId;

    /**
     * @var string
     *
     * @ORM\Column(name="isa_number", type="string", length=30, nullable=false)
     */
    private $isaNumber;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="transaction_date", type="datetime", nullable=false)
     */
    private $transactionDate;

    /**
     * @var string
     *
     * @ORM\Column(name="gs_number", type="string", length=15, nullable=false)
     */
    private $gsNumber;

    /**
     * @var string
     *
     * @ORM\Column(name="file_name", type="string", length=60, nullable=false)
     */
    private $fileName;

    /**
     * @var string
     *
     * @ORM\Column(name="file_path", type="string", length=100, nullable=false)
     */
    private $filePath;

    /**
     * @var integer
     *
     * @ORM\Column(name="edi_transaction_id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $ediTransactionId;

    /**
     * @var \Matrix\MatrixEdiBundle\Entity\EdiDocType
     *
     * @ORM\ManyToOne(targetEntity="Matrix\MatrixEdiBundle\Entity\EdiDocType")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="edi_doc_type_id", referencedColumnName="edi_doc_type_id")
     * })
     */
    private $ediDocType;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="creation_date", type="datetime", nullable=false)
     */
    private $creationDate;

    /**
     * @var string
     *
     * @ORM\Column(name="created_by", type="string", length=50, nullable=false)
     */
    private $createdBy;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="update_date", type="datetime", nullable=false)
     */
    private $updateDate;

    /**
     * @var string
     *
     * @ORM\Column(name="updated_by", type="string", length=50, nullable=false)
     */
    private $updatedBy;

    /**
     * @var integer
     *
     * @ORM\Column(name="flag", type="integer", nullable=false)
     */
    private $flag;

    /**
     * Set senderId
     *
     * @param string $senderId
     * @return EdiTransaction
     */
    public function setSenderId($senderId)
    {
        $this->senderId = $senderId;

        return $this;
    }

    /**
     * Get senderId
     *
     * @return string 
     */
    public function getSenderId()
    {
        return $this->senderId;
    }

    /**
     * Set receiverId
     *
     * @param string $receiverId
     * @return EdiTransaction
     */
    public function setReceiverId($receiverId)
    {
        $this->receiverId = $receiverId;

        return $this;
    }

    /**
     * Get receiverId
     *
     * @return string 
     */
    public function getReceiverId()
    {
        return $this->receiverId;
    }

    /**
     * Set isaNumber
     *
     * @param string $isaNumber
     * @return EdiTransaction
     */
    public function setIsaNumber($isaNumber)
    {
        $this->isaNumber = $isaNumber;

        return $this;
    }

    /**
     * Get isaNumber
     *
     * @return string 
     */
    public function getIsaNumber()
    {
        return $this->isaNumber;
    }

    /**
     * Set transactionDate
     *
     * @param \DateTime $transactionDate
     * @return EdiTransaction
     */
    public function setTransactionDate($transactionDate)
    {
        $this->transactionDate = $transactionDate;

        return $this;
    }

    /**
     * Get transactionDate
     *
     * @return \DateTime 
     */
    public function getTransactionDate()
    {
        return $this->transactionDate;
    }

    /**
     * Set gsNumber
     *
     * @param string $gsNumber
     * @return EdiTransaction
     */
    public function setGsNumber($gsNumber)
    {
        $this->gsNumber = $gsNumber;

        return $this;
    }

    /**
     * Get gsNumber
     *
     * @return string 
     */
    public function getGsNumber()
    {
        return $this->gsNumber;
    }

    /**
     * Set fileName
     *
     * @param string $fileName
     * @return EdiTransaction
     */
    public function setFileName($fileName)
    {
        $this->fileName = $fileName;

        return $this;
    }

    /**
     * Get fileName
     *
     * @return string 
     */
    public function getFileName()
    {
        return $this->fileName;
    }

    /**
     * Set filePath
     *
     * @param string $filePath
     * @return EdiTransaction
     */
    public function setFilePath($filePath)
    {
        $this->filePath = $filePath;

        return $this;
    }

    /**
     * Get filePath
     *
     * @return string 
     */
    public function getFilePath()
    {
        return $this->filePath;
    }

    /**
     * Get ediTransactionId
     *
     * @return integer 
     */
    public function getEdiTransactionId()
    {
        return $this->ediTransactionId;
    }

    /**
     * Set ediDocType
     *
     * @param \Matrix\MatrixEdiBundle\Entity\EdiDocType $ediDocType
     * @return EdiTransaction
     */
    public function setEdiDocType(\Matrix\MatrixEdiBundle\Entity\EdiDocType $ediDocType = null)
    {
        $this->ediDocType = $ediDocType;

        return $this;
    }

    /**
     * Get ediDocType
     *
     * @return \Matrix\MatrixEdiBundle\Entity\EdiDocType 
     */
    public function getEdiDocType()
    {
        return $this->ediDocType;
    }

    /**
     * Set creationDate
     *
     * @param \DateTime $creationDate
     * @return EdiTransaction
     */
    public function setCreationDate($creationDate)
    {
        $this->creationDate = $creationDate;

        return $this;
    }

    /**
     * Get creationDate
     *
     * @return \DateTime 
     */
    public function getCreationDate()
    {
        return $this->creationDate;
    }

    /**
     * Set createdBy
     *
     * @param string $createdBy
     * @return EdiTransaction
     */
    public function setCreatedBy($createdBy)
    {
        $this->createdBy = $createdBy;

        return $this;
    }

    /**
     * Get createdBy
     *
     * @return string 
     */
    public function getCreatedBy()
    {
        return $this->createdBy;
    }

    /**
     * Set updateDate
     *
     * @param \DateTime $updateDate
     * @return EdiTransaction
     */
    public function setUpdateDate($updateDate)
    {
        $this->updateDate = $updateDate;

        return $this;
    }

    /**
     * Get updateDate
     *
     * @return \DateTime 
     */
    public function getUpdateDate()
    {
        return $this->updateDate;
    }

    /**
     * Set updatedBy
     *
     * @param string $updatedBy
     * @return EdiTransaction
     */
    public function setUpdatedBy($updatedBy)
    {
        $this->updatedBy = $updatedBy;

        return $this;
    }

    /**
     * Get updatedBy
     *
     * @return string 
     */
    public function getUpdatedBy()
    {
        return $this->updatedBy;
    }

     /**
     * Set flag
     *
     * @param integer $flag
     * @return EdiTransaction
     */
    public function setFlag($flag)
    {
        $this->flag = $flag;

        return $this;
    }

    /**
     * Get flag
     *
     * @return integer 
     */
    public function getFlag()
    {
        return $this->flag;
    }

}

0 个答案:

没有答案