Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-21-2020 03:06 AM
Hello,
I am using spring-boot-starter-data-neo4j to model my graph and i have :
@NodeEntity("App")
public class ApplicationEntity {
@Id
@GeneratedValue
Long id;
String name;
@Labels
List<String> nodeLabels;
@Relationship(type = "CALLS")
private List<ApplicationEntity> apps = new ArrayList<>();
}
When i get an ApplicationEntity and i do .getNodeLabels()
i dont have the App
label, i have all other labels but not the default one.
How can i get all labels include the default one.
Thank you.
10-21-2020 05:45 AM
You know the class you are loading, so if you would externalize the node entity label into a constant, you could access it.
A more advanced idea would be if you have inheritance or similar, to put the class and the label into a map, to access it via the class.
We basically do the second one internally but there is no officially documented (and supported) API. If you have access to a SessionFactory
instance, you could do sessionFactory.metaData().classInfo(ApplicationEntity.class).staticLabels()
All the sessions of the conference are now available online