Do not use fetch join, as even with the N+1 problem the queries are faster than with the very complex and slow expressions needed for the fetch Join pagination

This commit is contained in:
Jan Böhmer 2023-07-22 23:51:06 +02:00
parent 8ce5f4a796
commit d59b8817c3
3 changed files with 102 additions and 13 deletions

View file

@ -22,6 +22,7 @@ declare(strict_types=1);
namespace App\Entity\Parts;
use App\Repository\PartLotRepository;
use Doctrine\DBAL\Types\Types;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Base\TimestampTrait;
@ -79,7 +80,7 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
* @var Storelocation|null The storelocation of this lot
*/
#[Groups(['simple', 'extended', 'full', 'import'])]
#[ORM\ManyToOne(targetEntity: Storelocation::class)]
#[ORM\ManyToOne(targetEntity: Storelocation::class, fetch: 'EAGER')]
#[ORM\JoinColumn(name: 'id_store_location')]
#[Selectable()]
protected ?Storelocation $storage_location = null;