Код: Выделить всё
@Node
public class Variation extends BaseEntity {
private String title;
@Relationship(type = "HAS_ATTRIBUTE", direction = Relationship.Direction.OUTGOING)
private Type type;
// Other fields and relationships...
}
@Node
public enum Type {
CUSTOM(0),
FIX(1),
// Other constants...
@Id
private final int id;
Type(int id) {
this.id = id;
}
}
Код: Выделить всё
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-neo4j'
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
}
Код: Выделить всё
java.lang.IllegalStateException: Required property $enum$name not found for class org.com.example.node.Type
at org.springframework.data.mapping.PersistentEntity.getRequiredPersistentProperty
...
Мой вопрос:
- Как настроить Spring Data Neo4j для правильного сопоставления перечислений, таких как
Тип как узлы? - Существует ли особый способ обработки перечислений
свойства в Neo4j при использовании Spring Data?
Подробнее здесь: https://stackoverflow.com/questions/791 ... ot-found-w