{"action":"created","issue":{"url":"https://api.github.com/repos/neo4j/neo4j-ogm/issues/437","repository_url":"https://api.github.com/repos/neo4j/neo4j-ogm","labels_url":"https://api.github.com/repos/neo4j/neo4j-ogm/issues/437/labels{/name}","comments_url":"https://api.github.com/repos/neo4j/neo4j-ogm/issues/437/comments","events_url":"https://api.github.com/repos/neo4j/neo4j-ogm/issues/437/events","html_url":"https://github.com/neo4j/neo4j-ogm/issues/437","id":276721108,"node_id":"MDU6SXNzdWUyNzY3MjExMDg=","number":437,"title":"AutoIndex label NPE during initialization and index lookup","user":{"login":"jdorleans","id":1254399,"node_id":"MDQ6VXNlcjEyNTQzOTk=","avatar_url":"https://avatars3.githubusercontent.com/u/1254399?v=4","gravatar_id":"","url":"https://api.github.com/users/jdorleans","html_url":"https://github.com/jdorleans","followers_url":"https://api.github.com/users/jdorleans/followers","following_url":"https://api.github.com/users/jdorleans/following{/other_user}","gists_url":"https://api.github.com/users/jdorleans/gists{/gist_id}","starred_url":"https://api.github.com/users/jdorleans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdorleans/subscriptions","organizations_url":"https://api.github.com/users/jdorleans/orgs","repos_url":"https://api.github.com/users/jdorleans/repos","events_url":"https://api.github.com/users/jdorleans/events{/privacy}","received_events_url":"https://api.github.com/users/jdorleans/received_events","type":"User","site_admin":false},"labels":[{"id":130813502,"node_id":"MDU6TGFiZWwxMzA4MTM1MDI=","url":"https://api.github.com/repos/neo4j/neo4j-ogm/labels/bug","name":"bug","color":"EB5A46","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-11-25T03:02:25Z","updated_at":"2018-07-31T21:14:56Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<!-- ================================================================= -->\r\n<!-- Please note that GitHub issues are only meant for bug reports/feature requests. -->\r\n<!-- If you have questions on how to use the Neo4j OGM, please ask on -->\r\n<!-- StackOverflow: http://stackoverflow.com/questions/tagged/neo4j-ogm instead of -->\r\n<!-- creating an issue here. -->\r\n<!-- ================================================================= -->\r\n\r\n<!--- Provide a general summary of the issue in the Title above -->\r\n\r\n## Expected Behavior\r\n<!--- If you're describing a bug, tell us what should happen -->\r\n<!--- If you're suggesting a change/improvement, tell us how it should work -->\r\nAll my entity nodes extend an abstract base class called `Entity` which contains `@Id` and common methods for all entities. `Entity` is **not** annotated with `@NodeEntity` since I do not want to save its label.\r\n\r\nDue to `@Id` and the new AutoIndex functionality in OGM v3.x, the SessionFactory initialization fails with a NPE during AutoIndex creation. This is caused because `@Id` is considered a potential index by AutoIndexManager at `initialiseIndexMetadata()` and since Entity has no label AutoIndex creation throws a NPE.    \r\n\r\nTo solve that I'm now forced to use `@NodeEntity` in my abstract Entity class, so it contains a valid label to be used during AutoIndex creation. However, I'd except AutoIndex to pick the simple class name as label for the leaf children in the hierarchy. For instance:\r\n\r\nEntity --> OtherEntity --> FinalEntity\r\nlabel = `FinalEntity`\r\nwhere: Entity and OtherEntity are abstractions\r\n\r\nNOTE: This behaviour is also suggested on the documentation:\r\nhttps://neo4j.com/docs/ogm-manual/current/tutorial/#tutorial:annotations:graphid\r\n\r\n## Current Behavior\r\n<!--- If describing a bug, tell us what happens instead of the expected behavior -->\r\n<!--- If suggesting a change/improvement, explain the difference from current behavior -->\r\nNPE during AutoIndex creation for `label` param at: https://github.com/neo4j/neo4j-ogm/blob/master/core/src/main/java/org/neo4j/ogm/autoindex/AutoIndex.java#L66\r\n```\r\njava.lang.NullPointerException\r\n\tat org.neo4j.ogm.autoindex.AutoIndex.createDescription(AutoIndex.java:66)\r\n\tat org.neo4j.ogm.autoindex.AutoIndex.<init>(AutoIndex.java:61)\r\n\tat org.neo4j.ogm.autoindex.AutoIndexManager.initialiseIndexMetadata(AutoIndexManager.java:72)\r\n\tat org.neo4j.ogm.autoindex.AutoIndexManager.<init>(AutoIndexManager.java:57)\r\n\tat org.neo4j.ogm.session.SessionFactory.<init>(SessionFactory.java:84)\r\n```\r\n## Possible Solution\r\n<!--- Not obligatory, but suggest a fix/reason for the bug, -->\r\n<!--- or ideas how to implement the addition or change -->\r\nIt seems the change would be somewhere inside ClassInfo or MetaData. The framework should be capable of checking the hierarchy in between the classes and set the potential indexes to the end classes and all annotated abstract ones.\r\n\r\n## Steps to Reproduce (for bugs)\r\n<!--- Provide a link to a live example, or an unambiguous set of steps to -->\r\n<!--- reproduce this bug. Include code to reproduce, if relevant -->\r\n<!-- Additionally, include (as appropriate) log-files, stacktraces, and other debug output. -->\r\n<!-- There are templates to help reproducing issues here : https://github.com/neo4j-examples/neo4j-sdn-ogm-issue-report-template. -->\r\n1. Create an abstract Entity with `@Id` and do not use `@NodeEntity`\r\n2. Extend Entity with a second child AnotherEntity class and do not use `@NodeEntity`\r\n3. That should be enough to fail during SessionFactory initialization of AutoIndex\r\n\r\n## Your Environment\r\n<!--- Include as many relevant details about the environment you experienced the bug in -->\r\n- OGM Version used: 3\r\n"},"comment":{"url":"https://api.github.com/repos/neo4j/neo4j-ogm/issues/comments/409370304","html_url":"https://github.com/neo4j/neo4j-ogm/issues/437#issuecomment-409370304","issue_url":"https://api.github.com/repos/neo4j/neo4j-ogm/issues/437","id":409370304,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTM3MDMwNA==","user":{"login":"yuniel-acosta","id":33158051,"node_id":"MDQ6VXNlcjMzMTU4MDUx","avatar_url":"https://avatars2.githubusercontent.com/u/33158051?v=4","gravatar_id":"","url":"https://api.github.com/users/yuniel-acosta","html_url":"https://github.com/yuniel-acosta","followers_url":"https://api.github.com/users/yuniel-acosta/followers","following_url":"https://api.github.com/users/yuniel-acosta/following{/other_user}","gists_url":"https://api.github.com/users/yuniel-acosta/gists{/gist_id}","starred_url":"https://api.github.com/users/yuniel-acosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuniel-acosta/subscriptions","organizations_url":"https://api.github.com/users/yuniel-acosta/orgs","repos_url":"https://api.github.com/users/yuniel-acosta/repos","events_url":"https://api.github.com/users/yuniel-acosta/events{/privacy}","received_events_url":"https://api.github.com/users/yuniel-acosta/received_events","type":"User","site_admin":false},"created_at":"2018-07-31T21:14:56Z","updated_at":"2018-07-31T21:14:56Z","author_association":"NONE","body":"Can someone tell me if there is already a solution for this problem? I have spent hours searching the internet to see a solution for this problem but I have not found anything if someone could tell me if it is already solved or is working on that error. I am currently using Spring Data Neo4j Version 5.0.9 and Server Neo4j version 3.0.10"}}
{"actor":{"display_login":"yuniel-acosta"}}