Skip to content

Sample project to demonstrate how to resolve issues with missing QAbstractPersistable in generated querydsl meta-model classes

Notifications You must be signed in to change notification settings

KlausUnger-SoftwareCraftsmen/spring-data-jpa-querydsl-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-data-jpa-querydsl-sample

Sample project to demonstrate how to resolve issues with missing QAbstractPersistable in generated querydsl meta-model classes.

Issues

see: DATAJPA-1282: Meta-model classes no longer contained in binaries

Background

Since the 2.x version, the artifacts for Spring Data JPA do not contain the compiled querydsl meta-model classes QAbstractPersistable and QAbstractAuditable anymore.

This will lead to compile errors in the generated Q-source files with the following messages.

/target/generated-sources/java/at/softwarecraftsmen/jpa_querydsl_sample/domain/QUser.java:22: error: cannot find symbol
    public final org.springframework.data.jpa.domain.QAbstractPersistable _super = new org.springframework.data.jpa.domain.QAbstractPersistable(this);
                                                    ^
  symbol:   class QAbstractPersistable
  location: package org.springframework.data.jpa.domain
  
[ERROR] target/generated-sources/java/at/softwarecraftsmen/jpa_querydsl_sample/domain/QUser.java:[22,53] cannot find symbol
  symbol:   class QAbstractPersistable
  location: package org.springframework.data.jpa.domain

Solution

Till the fix versions will be released, this repo shows a convenient workaround/fix.

Providing a simple package-info.java file inside the domain package, where your entities are located, with the following content resolves the problem.

@QueryEntities(value = {AbstractPersistable.class, AbstractAuditable.class})
package at.softwarecraftsmen.jpa_querydsl_sample.domain;

import com.querydsl.core.annotations.QueryEntities;
import org.springframework.data.jpa.domain.AbstractAuditable;
import org.springframework.data.jpa.domain.AbstractPersistable;

Contact

Klaus UNGER [email protected]

About

Sample project to demonstrate how to resolve issues with missing QAbstractPersistable in generated querydsl meta-model classes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages