Unable to genrate Querybeans #3492
Replies: 6 comments
-
Have you got an
When using Lombok on entity beans we need that annotation processor to be BEFORE the querybean-generator. So try moving the Lombok annotation processor to be the first annotation processor. |
Beta Was this translation helpful? Give feedback.
-
Just to say I would not promote the use of |
Beta Was this translation helpful? Give feedback.
-
hi @rbygrave thanks for your email i have made the changes as per your suggestions.. but still no luck.. my base object is now like package com.dpl.rating.domain;
import io.ebean.Model;
import io.ebean.annotation.WhenCreated;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.persistence.Id;
import jakarta.persistence.MappedSuperclass;
import lombok.Getter;
import lombok.Setter;
import java.time.Instant;
@MappedSuperclass
@Getter
@Setter
public abstract class BaseDomain extends Model {
@Id
@EqualsAndHashCode.Include
long id;
@WhenCreated
protected Instant created;
} my entity is package com.dpl.rating.domain;
import lombok.*;
import server.com.dpl.rating.api.model.Margin;
import com.dpl.rating.domain.transaction.AgentTransaction;
import jakarta.persistence.Entity;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static java.time.LocalDateTime.now;
import static java.util.Collections.emptyMap;
import static java.util.function.Function.identity;
import static java.util.stream.Collectors.toMap;
import static jakarta.persistence.CascadeType.ALL;
@Entity
@Table(name = "agent")
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Agent extends BaseDomain {
private String code;
private String name;
private String uuid;
@ManyToOne
private Group group;
@OneToMany I also changed my build to be <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<release>${java.version}</release>
<source>${java.version}</source>
<target>${java.version}</target>
<executable>javac</executable>
<useIncrementalCompilation>false</useIncrementalCompilation>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
<path>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>${ebean.version}</version>
</path>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins> i must be missing something, as mvn clean install gives me [ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/dharshana/development/turners/dorchester-pacific-limited/code/service/rating-service/src/main/java/com/dpl/rating/service/AgentService.java:[9,35] package com.dpl.rating.domain.query does not exist
[ERROR] /home/dharshana/development/turners/dorchester-pacific-limited/code/service/rating-service/src/main/java/com/dpl/rating/service/AgentService.java:[10,35] package com.dpl.rating.domain.query does not exist
[ERROR] /home/dharshana/development/turners/dorchester-pacific-limited/code/service/rating-service/src/main/java/com/dpl/rating/service/AgentService.java:[11,35] package com.dpl.rating.domain.query does not exist
[ERROR] /home/dharshana/development/turners/dorchester-pacific-limited/code/service/rating-service/src/main/java/com/dpl/rating/service/AgentService.java:[12,35] package com.dpl.rating.domain.query does not exist
[ERROR] /home/dharshana/development/turners/dorchester-pacific-limited/code/service/rating-service/src/main/java/com/dpl/rating/service/AgentService.java:[14,47] package com.dpl.rating.domain.transaction.query does not exist
[ERROR] /home/dharshana/development/turners/dorchester-pacific-limited/code/service/rating-service/src/main/java/com/dpl/rating/service/TierService.java:[8,35] package com.dpl.rating.domain.query does not exist
[ERROR] /home/dharshana/development/turners/dorchester-pacific-limited/code/service/rating-service/src/main/java/com/dpl/rating/service/TierService.java:[9,35] package com.dpl.rating.domain.query does not exist
[ERROR] /home/dharshana/development/turners/dorchester-pacific-limited/code/service/rating-service/src/main/java/com/dpl/rating/service/TierService.java:[10,35] package com.dpl.rating.domain.query does not exist
[ERROR] /home/dharshana/development/turners/dorchester-pacific-limited/code/service/rating-service/src/main/java/com/dpl/rating/service/TierService.java:[11,35] package com.dpl.rating.domain.query does not exist
[ERROR] /home/dharshana/development/turners/dorchester-pacific-limited/code/service/rating-service/src/main/java/com/dpl/rating/service/AgentRatesTierComparisonService.java:[11,35] package com.dpl.rating.domain.query does not exist
looks like lombok isnt working either as im also getting [ERROR] /home/dharshana/development/turners/dorchester-pacific-limited/code/service/rating-service/src/main/java/com/dpl/rating/service/TierService.java:[68,34] cannot find symbol
[ERROR] symbol: method builder()
[ERROR] location: class com.dpl.rating.domain.Tier perhaps i need to get that working first? |
Beta Was this translation helpful? Give feedback.
-
Yeah, I'd be tempted to temporarily simplify down to only 1 annotation processor like the querybean-generator only, or lombok only. It could be there is some unreported error so perhaps a |
Beta Was this translation helpful? Give feedback.
-
Another option is to
|
Beta Was this translation helpful? Give feedback.
-
thanks @rbygrave .. started from your example and got it working.. must be an issues with the project i was working with.. Im unblocked now.. thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi Team
Ive been following the documentation and trying various thing for a few hours, but i cant seem to get the queybean generation to work.
my classes look like
i have added to my pom.xml
I have also installed the ebean enhancement intellij plugin, I have enabled annotation processing and enabled ebean enhancement. But i see no querybeans on
target/generated-sources/annotations
and building the project gives me compile errors about missing query beans
mvn clean install gives the same compile errors.
Im not sure if lombok is interfering somehow
I do have a src/main/resources/ebean.mfsrc/main/resources/ebean.mf
entity-packages: com.dpl.rating
Beta Was this translation helpful? Give feedback.
All reactions