package com.kamco.cd.training.postgres.repository.menu;

import static com.kamco.cd.training.postgres.entity.QMenuEntity.menuEntity;

import com.kamco.cd.training.postgres.entity.MenuEntity;
import com.querydsl.jpa.impl.JPAQueryFactory;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

@Repository
@RequiredArgsConstructor
public class MenuRepositoryImpl implements MenuRepositoryCustom {

  private final JPAQueryFactory queryFactory;

  @Override
  public List<MenuEntity> getFindAll() {
    return queryFactory.selectFrom(menuEntity).where(menuEntity.deleted.isFalse()).fetch();
  }
}
