4.2. Multithreaded initialization of Querydsl Q-types

When Querydsl Q-types are initialized from multiple threads, deadlocks can occur, if the Q-types have circular dependencies.

An easy to use solution is to initialize the classes in a single thread before they are used in different threads.

The com.querydsl.codegen.ClassPathUtils class can be used for that like this:

    ClassPathUtils.scanPackage(Thread.currentThread().getContextClassLoader(), packageToLoad);

Replace packageToLoad with the package of the classes you want to initialize.