org.neo4j.ogm.exception.MappingException: Error mapping GraphModel to instance of ***.ProjectGraph
5062 단어 neo4j
Exception in thread "main" org.neo4j.ogm.exception.MappingException: Error mapping GraphModel to instance of .ProjectGraph
at org.neo4j.ogm.context.GraphEntityMapper.mapEntities(GraphEntityMapper.java:145)
at org.neo4j.ogm.context.GraphEntityMapper.map(GraphEntityMapper.java:117)
at org.neo4j.ogm.context.GraphEntityMapper.map(GraphEntityMapper.java:81)
at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.executeAndMap(ExecuteQueriesDelegate.java:111)
at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.query(ExecuteQueriesDelegate.java:82)
at org.neo4j.ogm.session.Neo4jSession.query(Neo4jSession.java:323)
Caused by: org.neo4j.ogm.exception.MappingException: Unable to instantiate class .ProjectGraph
at org.neo4j.ogm.annotations.EntityFactory.instantiate(EntityFactory.java:137)
at org.neo4j.ogm.annotations.EntityFactory.instantiateObjectFromTaxa(EntityFactory.java:110)
at org.neo4j.ogm.annotations.EntityFactory.newObject(EntityFactory.java:61)
at org.neo4j.ogm.context.GraphEntityMapper.mapNodes(GraphEntityMapper.java:156)
at org.neo4j.ogm.context.GraphEntityMapper.mapEntities(GraphEntityMapper.java:142)
... 7 more
Caused by: java.lang.NoSuchMethodException: .ProjectGraph.()
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getDeclaredConstructor(Class.java:2178)
at org.neo4j.ogm.annotations.EntityFactory.instantiate(EntityFactory.java:133)
... 11 more
원인: ProjectGraph.java는 아무런 속성도 없는 구조 함수를 필요로 합니다. 프로젝트 Graph에 아무런 속성도 없는 구조 함수를 보완해야 합니다.
ProjectGraph.java 오류 코드:
import java.util.List;
import org.neo4j.ogm.annotation.GraphId;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Relationship;
/**
*
*
*
*/
@NodeEntity
@SuppressWarnings("serial")
public class ProjectGraph implements java.io.Serializable{
@GraphId
private Long id;
private String name;
private String sid;
@Relationship(type = "IndividualLicenseRelation")
private List licenses;
@Relationship(type = "IndividualResponRelation")
private List respons;
@Relationship(type = "IndividualUnitRelation")
private List units;
//set get
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSid() {
return sid;
}
public void setSid(String sid) {
this.sid = sid;
}
public List getLicenses() {
return licenses;
}
public void setLicenses(List licenses) {
this.licenses = licenses;
}
public List getRespons() {
return respons;
}
public void setRespons(List respons) {
this.respons = respons;
}
public List getUnits() {
return units;
}
public void setUnits(List units) {
this.units = units;
}
public ProjectGraph(String name, String sid) {
this.name = name;
this.sid = sid;
}
}
ProjectGraph.java 수정된 코드:
import java.util.List;
import org.neo4j.ogm.annotation.GraphId;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Relationship;
/**
*
*
*
*/
@NodeEntity
@SuppressWarnings("serial")
public class ProjectGraph implements java.io.Serializable{
@GraphId
private Long id;
private String name;
private String sid;
@Relationship(type = "IndividualLicenseRelation")
private List licenses;
@Relationship(type = "IndividualResponRelation")
private List respons;
@Relationship(type = "IndividualUnitRelation")
private List units;
//set get
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSid() {
return sid;
}
public void setSid(String sid) {
this.sid = sid;
}
public List getLicenses() {
return licenses;
}
public void setLicenses(List licenses) {
this.licenses = licenses;
}
public List getRespons() {
return respons;
}
public void setRespons(List respons) {
this.respons = respons;
}
public List getUnits() {
return units;
}
public void setUnits(List units) {
this.units = units;
}
//
public ProjectGraph() {
super();
}
public ProjectGraph(String name, String sid) {
this.name = name;
this.sid = sid;
}
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
🔵SQL X Cypher/Neo4j: quais amigos dos meus amigos são meus inimigos?Neste post vamos comparar uma Consulta feita com SQL e a mesma Consulta feita com CYPHER; 언어는 Neo4j입니다. Vamos pesquisar ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.