cancel
Showing results for 
Search instead for 
Did you mean: 

Join the community at Nodes 2022, our free virtual event on November 16 - 17.

FIXED - OGM - AmbiguousBaseClassException

sylvainroussy
Node Clone

Hi!

I'm trying to add dynamic label on an NodeEntity, the storage was fine but when I want to access to the node I got an AmbiguousBaseClassException:

java.lang.RuntimeException: org.springframework.dao.InvalidDataAccessApiUsageException: Multiple classes found in type hierarchy that map to: [MyEntity, Imprint, OrganizationType]; nested exception is org.neo4j.ogm.exception.core.AmbiguousBaseClassException: Multiple classes found in type hierarchy that map to: [MyEntity, Imprint, OrganizationType]
at mypackage.ProfileTest.profileTest(ProfileTest.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

This is my entity:

@NodeEntity (label="OrganizationType")
@SuppressWarnings ("serial")
public class OrganizationType extends MyEntity{

@Id
private String organizationId;
	
// Possible labels are :
// "Imprint" "Library"  "Bookshop" "Media" "BigEvent"  "Publics"  "Institution" "OtherBusiness" 
	
@Labels
private List<String> labels = new ArrayList<>();
	
@Properties 
private Map<String,Object> properties = new HashMap<String,Object>();

public List<String> getLabels() {
	return labels;
}

public void setLabels(List<String> labels) {
	this.labels = labels;
}
	
public void addLabel(String label) {
	this.labels.add(label);
}

public Map<String, Object> getProperties() {
	return properties;
}

public void setProperties(Map<String, Object> properties) {
	this.properties = properties;
}
	
public String getOrganizationId() {
	return organizationId;
}

public void setOrganizationId(String organizationId) {
	this.organizationId = organizationId;
}		
}

Environment:

  • OGM Version used: 3.1.13
  • SDN version used: 5.1.8
  • Java Version used: 1.8
  • Neo4J Version used: 3.5.5

Did I miss something?

1 ACCEPTED SOLUTION

sylvainroussy
Node Clone

Fixed,
I had a class named Imprint, like the label putted in the labels property of the node entity.

View solution in original post

1 REPLY 1

sylvainroussy
Node Clone

Fixed,
I had a class named Imprint, like the label putted in the labels property of the node entity.