gpt4 book ai didi

java - Achilles 4.2.0编译错误 - 找不到符号symbol : class Table location: package info. archinnov.achilles.annotations

转载 作者:太空宇宙 更新时间:2023-11-04 12:27:34 24 4
gpt4 key购买 nike

我在编译简单的 achilles maven 项目时遇到一些问题。我的 pom.xml:

<dependencies>
<dependency>
<groupId>info.archinnov</groupId>
<artifactId>achilles-core</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>info.archinnov</groupId>
<artifactId>achilles-model</artifactId>
<version>4.2.0</version>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
</plugin>
</plugins>
</build>

我像这样配置了 Intellij Idea Annotation Process:https://github.com/doanduyhai/Achilles/wiki/IDE-configuration

当我尝试运行 mvn -X clean install 时,我遇到了一些编译错误:

[ERROR] /home/konrad/Pulpit/CassandraAchilles/target/generated-sources/annotations/info/archinnov/achilles/generated/meta/entity/User_AchillesMeta.java:[49,69] cannot find symbol
symbol: class User
[ERROR] /home/konrad/Pulpit/CassandraAchilles/target/generated-sources/annotations/info/archinnov/achilles/generated/manager/User_Manager.java:[25,57] cannot find symbol
symbol: class User
[ERROR] /home/konrad/Pulpit/CassandraAchilles/target/generated-sources/annotations/info/archinnov/achilles/generated/meta/entity/User_AchillesMeta.java:[59,38] cannot find symbol
symbol: class User
location: class info.archinnov.achilles.generated.meta.entity.User_AchillesMeta
[ERROR] /home/konrad/Pulpit/CassandraAchilles/target/generated-sources/annotations/info/archinnov/achilles/generated/meta/entity/User_AchillesMeta.java:[70,38] cannot find symbol
symbol: class User
location: class info.archinnov.achilles.generated.meta.entity.User_AchillesMeta

用户是我的实体:

import info.archinnov.achilles.annotations.Column;
import info.archinnov.achilles.annotations.PartitionKey;
import info.archinnov.achilles.annotations.Table;

@Table(keyspace = "example", table = "user")
public class User {

@PartitionKey
private Long id;

@Column("fname")
private String firstName;

@Column("age")
private int age;


public User() {
}

public User(Long id, String firstName, int age) {
this.id = id;
this.firstName = firstName;
this.age = age;
}

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getFirstName() {
return firstName;
}

public void setFirstName(String firstName) {
this.firstName = firstName;
}

public int getAge() {
return age;
}

public void setAge(int age) {
this.age = age;
}
}

我做错了什么?

最佳答案

对我来说User类包含到包中解决了问题。

问题似乎出在代码的生成方式上,正如 IDE configuration page 末尾所解释的那样。你提到:

In some cases, if the processor does not generate the code correctly, you may need to do a clean build with Maven (this is actually the only method that is working 100% in any case). For this open a shell terminal and type mvn clean compile then go back to the IDE and refresh your project, you should see the generated code.

关于java - Achilles 4.2.0编译错误 - 找不到符号symbol : class Table location: package info. archinnov.achilles.annotations,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38201192/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com