Search code examples
javagit-submodulesquerydsl

QueryDsl does not generate q-classes for @Entity classes of git submodules


I have a java project (spring boot) with git submodules. I've added QueryDsl to my project but it generates q-classes only for @Entity classes of main project, not for @Entity classes of submodules.

What should I do to fix it?

p.s. Spring Data works well, all @Entity classes are available to use.


Solution

  • Add a package-info.java file to your own project, that references the classes from the child project in @QueryEntities:

    @QueryEntities({
            BlobEntity.class
    })
    package com.pallasathenagroup.querydsl;
    
    import com.blazebit.persistence.testsuite.entity.BlobEntity;
    import com.querydsl.core.annotations.QueryEntities;