{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/spring-data-gremlin/issues/131","repository_url":"https://api.github.com/repos/Microsoft/spring-data-gremlin","labels_url":"https://api.github.com/repos/Microsoft/spring-data-gremlin/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/spring-data-gremlin/issues/131/comments","events_url":"https://api.github.com/repos/Microsoft/spring-data-gremlin/issues/131/events","html_url":"https://github.com/Microsoft/spring-data-gremlin/issues/131","id":346484029,"node_id":"MDU6SXNzdWUzNDY0ODQwMjk=","number":131,"title":"Why does @Id fields have to be String?","user":{"login":"kschulst","id":21902,"node_id":"MDQ6VXNlcjIxOTAy","avatar_url":"https://avatars1.githubusercontent.com/u/21902?v=4","gravatar_id":"","url":"https://api.github.com/users/kschulst","html_url":"https://github.com/kschulst","followers_url":"https://api.github.com/users/kschulst/followers","following_url":"https://api.github.com/users/kschulst/following{/other_user}","gists_url":"https://api.github.com/users/kschulst/gists{/gist_id}","starred_url":"https://api.github.com/users/kschulst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kschulst/subscriptions","organizations_url":"https://api.github.com/users/kschulst/orgs","repos_url":"https://api.github.com/users/kschulst/repos","events_url":"https://api.github.com/users/kschulst/events{/privacy}","received_events_url":"https://api.github.com/users/kschulst/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-08-01T07:42:03Z","updated_at":"2018-08-02T07:35:24Z","closed_at":null,"author_association":"NONE","body":"I'm experimenting spring-data-gremlin, using the tinkerpop gremlin-server as backend. I am playing with the \"modern graph\" supplied by the gremlin-server, which out of the box the graph has integer type IDs.\r\n\r\n![image](https://user-images.githubusercontent.com/21902/43507392-48ce65fa-956d-11e8-84f0-ff07ea73ae23.png)\r\n\r\nHowever, spring-data-gremlin enforces `@Id`-annotated fields to be `String`:\r\nhttps://github.com/Microsoft/spring-data-gremlin/blob/456264b22f527b8ac62a378d8076f36a818ea234/src/main/java/com/microsoft/spring/data/gremlin/common/GremlinUtils.java#L63-L65\r\n\r\nWhat is the reason for only allowing String? It seems that gremlin-server, when running in a default and naïve configuration, non-String IDs are being used.\r\n\r\nIf I save one of my vertice to the graph, using something like:\r\n```\r\npersonRepository.save(Person.builder().id(\"123\").name(\"joe\").build()));\r\n```\r\n...I end up with a vertex in the graph with a generated id (e.g. 17), and \"id\" as a property, like so:\r\n```\r\ngremlin> :> g.V(17).properties()\r\n==>vp[name->joe]\r\n==>vp[id->123]\r\n```"},"comment":{"url":"https://api.github.com/repos/Microsoft/spring-data-gremlin/issues/comments/409834872","html_url":"https://github.com/Microsoft/spring-data-gremlin/issues/131#issuecomment-409834872","issue_url":"https://api.github.com/repos/Microsoft/spring-data-gremlin/issues/131","id":409834872,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTgzNDg3Mg==","user":{"login":"kschulst","id":21902,"node_id":"MDQ6VXNlcjIxOTAy","avatar_url":"https://avatars1.githubusercontent.com/u/21902?v=4","gravatar_id":"","url":"https://api.github.com/users/kschulst","html_url":"https://github.com/kschulst","followers_url":"https://api.github.com/users/kschulst/followers","following_url":"https://api.github.com/users/kschulst/following{/other_user}","gists_url":"https://api.github.com/users/kschulst/gists{/gist_id}","starred_url":"https://api.github.com/users/kschulst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kschulst/subscriptions","organizations_url":"https://api.github.com/users/kschulst/orgs","repos_url":"https://api.github.com/users/kschulst/repos","events_url":"https://api.github.com/users/kschulst/events{/privacy}","received_events_url":"https://api.github.com/users/kschulst/received_events","type":"User","site_admin":false},"created_at":"2018-08-02T07:35:24Z","updated_at":"2018-08-02T07:35:24Z","author_association":"NONE","body":"We're not using `azure cosmosdb`. Right now I've only tested `gremlin-server`, but we're aiming to use `aws neptune` (I'm gonna see how this works with neptune later today).\r\n\r\nAnyway, spring-data-gremlin should work with all gremlin-compliant databases, such as `gremlin-server`. Might it be that the reason this works in `azure cosmosdb` is that it is more \"forgiving\"?\r\n\r\nI could create a PR that fixes this issue, if you're interested? "}}
{"actor":{"display_login":"kschulst"}}