-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code generation for class extending Hibernate Envers DefaultRevisionEntiry fails with JPAAnnotationProcessor when using JPA/Hibernate and Hibernate Envers #239
Comments
References to external annotated entity types are expected to have the Q-types already available in the classpath. To enforce the generation of of QDefaultRevisionEntity you can add the following annotation into a package-info.java file @QueryEntities({DefaultRevisionEntity.class})
package com.example.domain;
import org.hibernate.envers.DefaultRevisionEntity;
import com.mysema.query.annotations.QueryEntities; This will get you QDefaultRevisionEntity.java with the following contents package org.hibernate.envers;
import static com.mysema.query.types.PathMetadataFactory.*;
import com.mysema.query.types.*;
import com.mysema.query.types.path.*;
import javax.annotation.Generated;
/**
* QDefaultRevisionEntity is a Querydsl query type for DefaultRevisionEntity
*/
@Generated("com.mysema.query.codegen.EmbeddableSerializer")
public class QDefaultRevisionEntity extends BeanPath<DefaultRevisionEntity> {
private static final long serialVersionUID = -546101328;
public static final QDefaultRevisionEntity defaultRevisionEntity = new QDefaultRevisionEntity("defaultRevisionEntity");
public final NumberPath<Integer> id = createNumber("id", Integer.class);
public final DateTimePath<java.util.Date> revisionDate = createDateTime("revisionDate", java.util.Date.class);
public final NumberPath<Long> timestamp = createNumber("timestamp", Long.class);
public QDefaultRevisionEntity(String variable) {
super(DefaultRevisionEntity.class, forVariable(variable));
}
public QDefaultRevisionEntity(Path<? extends DefaultRevisionEntity> path) {
super(path.getType(), path.getMetadata());
}
public QDefaultRevisionEntity(PathMetadata<?> metadata) {
super(DefaultRevisionEntity.class, metadata);
}
} |
Thanks for the pointer, got it working! |
Wow! Thanks @timowest |
This worked for me. I think that maybe a solution where we can mark some hibernate entity to be ignored by jpa query dsl processor would be good as well. Because in this case, normally I don't think audited tables will have use case with query dsl. |
My model classes are annotated with JPA's
@Entity
annotation. All other classes are generated fine, except the one extending Hibernate Envers' DefaultRevisionEntity. The code generation fails with the following error duringmvn clean test
Revision.java:
pom.xml
The text was updated successfully, but these errors were encountered: