springboot启动出现了Field jpaQueryFactory in Controller required a bean of type ‘com.querydsl.jpa.impl.JP

    科技2024-05-31  77

    jpaQueryFactory还没有这个Bean注入 所以springboot无法启动

    //实体类管理者 @Autowired private EntityManager entityManager; //JPA查询工程 @Autowired private JPAQueryFactory jpaQueryFactory; @Bean @Autowired public JPAQueryFactory jpaQuery(EntityManager entityManager) { return new JPAQueryFactory(entityManager); }

    完美解决

    Processed: 0.010, SQL: 8