{"action":"created","issue":{"url":"https://api.github.com/repos/greenrobot/greenDAO/issues/388","repository_url":"https://api.github.com/repos/greenrobot/greenDAO","labels_url":"https://api.github.com/repos/greenrobot/greenDAO/issues/388/labels{/name}","comments_url":"https://api.github.com/repos/greenrobot/greenDAO/issues/388/comments","events_url":"https://api.github.com/repos/greenrobot/greenDAO/issues/388/events","html_url":"https://github.com/greenrobot/greenDAO/issues/388","id":169600907,"number":388,"title":"Use a String as primaryKey","user":{"login":"ChristianLJ","id":3056379,"avatar_url":"https://avatars.githubusercontent.com/u/3056379?v=3","gravatar_id":"","url":"https://api.github.com/users/ChristianLJ","html_url":"https://github.com/ChristianLJ","followers_url":"https://api.github.com/users/ChristianLJ/followers","following_url":"https://api.github.com/users/ChristianLJ/following{/other_user}","gists_url":"https://api.github.com/users/ChristianLJ/gists{/gist_id}","starred_url":"https://api.github.com/users/ChristianLJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChristianLJ/subscriptions","organizations_url":"https://api.github.com/users/ChristianLJ/orgs","repos_url":"https://api.github.com/users/ChristianLJ/repos","events_url":"https://api.github.com/users/ChristianLJ/events{/privacy}","received_events_url":"https://api.github.com/users/ChristianLJ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-05T12:54:52Z","updated_at":"2016-08-08T06:06:46Z","closed_at":null,"body":"In version 2.0 of GreenDao i had a table with a primary key called elementID which is a String. It was configured in the generator like this:\r\n```java\r\nelement.addStringProperty(\"elementID\").primaryKey();\r\n```\r\nWhen updating to GreenDao 3.1 i get the following error when building the project:\r\n```\r\nError:Execution failed for task ':app:greendao'.\r\n> Can't add field `Variable(type=VariableType(name=java.lang.String, isPrimitive=false, originalName=String, typeArguments=null), name=elementID)` for entity Element due to: Unsupported type java.lang.String\r\n```\r\nI have tried changing the attributes for the property like this with no change:\r\n```java\r\n @Index(unique = true)\r\n @NotNull\r\n @Id\r\n @Unique\r\n private String elementID;\r\n```\r\nAm i doing something wrong or does GreenDao 3.1 not support Strings as primaryKeys?"},"comment":{"url":"https://api.github.com/repos/greenrobot/greenDAO/issues/comments/238149067","html_url":"https://github.com/greenrobot/greenDAO/issues/388#issuecomment-238149067","issue_url":"https://api.github.com/repos/greenrobot/greenDAO/issues/388","id":238149067,"user":{"login":"greenrobot-team","id":13865709,"avatar_url":"https://avatars.githubusercontent.com/u/13865709?v=3","gravatar_id":"","url":"https://api.github.com/users/greenrobot-team","html_url":"https://github.com/greenrobot-team","followers_url":"https://api.github.com/users/greenrobot-team/followers","following_url":"https://api.github.com/users/greenrobot-team/following{/other_user}","gists_url":"https://api.github.com/users/greenrobot-team/gists{/gist_id}","starred_url":"https://api.github.com/users/greenrobot-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenrobot-team/subscriptions","organizations_url":"https://api.github.com/users/greenrobot-team/orgs","repos_url":"https://api.github.com/users/greenrobot-team/repos","events_url":"https://api.github.com/users/greenrobot-team/events{/privacy}","received_events_url":"https://api.github.com/users/greenrobot-team/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T06:06:46Z","updated_at":"2016-08-08T06:06:46Z","body":"Just noting: still only [Long is supported for primary keys](http://greenrobot.org/greendao/documentation/updating-to-greendao-3-and-annotations/#greenDAO_3_Entities_and_Annotations). I suppose what [was true for greenDAO 2](http://greenrobot.org/greendao/documentation/modelling-entities/#Properties_and_primary_keys) still applies to v3.\r\n\r\nHowever, I could get it working with:\r\n```java\r\n@Entity\r\npublic class ExampleEntity {\r\n    @Id\r\n    private String id;\r\n}\r\n```\r\n\r\nDo you maybe have an explicit `import java.lang.String;`? Try to remove it.\r\n\r\n-ut"}}
{"actor":{"display_login":"greenrobot-team"}}