{"action":"created","issue":{"url":"https://api.github.com/repos/datanucleus/datanucleus-api-jpa/issues/26","repository_url":"https://api.github.com/repos/datanucleus/datanucleus-api-jpa","labels_url":"https://api.github.com/repos/datanucleus/datanucleus-api-jpa/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/datanucleus/datanucleus-api-jpa/issues/26/comments","events_url":"https://api.github.com/repos/datanucleus/datanucleus-api-jpa/issues/26/events","html_url":"https://github.com/datanucleus/datanucleus-api-jpa/issues/26","id":163514460,"number":26,"title":"IdentifiableTypeImpl fails to retrieve PK information from MappedSuperClass","user":{"login":"mkolesnikov","id":754163,"avatar_url":"https://avatars.githubusercontent.com/u/754163?v=3","gravatar_id":"","url":"https://api.github.com/users/mkolesnikov","html_url":"https://github.com/mkolesnikov","followers_url":"https://api.github.com/users/mkolesnikov/followers","following_url":"https://api.github.com/users/mkolesnikov/following{/other_user}","gists_url":"https://api.github.com/users/mkolesnikov/gists{/gist_id}","starred_url":"https://api.github.com/users/mkolesnikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkolesnikov/subscriptions","organizations_url":"https://api.github.com/users/mkolesnikov/orgs","repos_url":"https://api.github.com/users/mkolesnikov/repos","events_url":"https://api.github.com/users/mkolesnikov/events{/privacy}","received_events_url":"https://api.github.com/users/mkolesnikov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/datanucleus/datanucleus-api-jpa/labels/testcase_required","name":"testcase_required","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-02T11:30:13Z","updated_at":"2016-07-02T11:49:10Z","closed_at":null,"body":"Here are domains classes:\r\n```java\r\n@MappedSuperclass\r\npublic abstract class BaseEntity<ID extends Serializable> {\r\n  @Id\r\n  @Column(name = ID)\r\n  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SEQ_GEN)\r\n  @SequenceGenerator(name = SEQ_GEN, allocationSize = 1)\r\n  private ID id;\r\n\r\n...\r\n}\r\n\r\n@Entity\r\npublic class Note extends BaseEntity<Long> {\r\n\r\n}\r\n```\r\nGetting exception:\r\n```\r\nCaused by: java.lang.IllegalArgumentException: PK member is not of specified type (java.lang.Long). Should be java.io.Serializable\r\n    at org.datanucleus.api.jpa.metamodel.IdentifiableTypeImpl.getId(IdentifiableTypeImpl.java:102)\r\n    at org.datanucleus.api.jpa.metamodel.IdentifiableTypeImpl.getId(IdentifiableTypeImpl.java:79)\r\n    at org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation$IdMetadata.<init>(JpaMetamodelEntityInformation.java:249)\r\n```\r\nIdentifiableTypeImpl.java\r\n```java\r\npublic <Y> SingularAttribute<? super X, Y> getId(Class<Y> cls)\r\n{\r\n...\r\n        int pkPosition = cmd.getPKMemberPositions()[0];\r\n        AbstractMemberMetaData mmd = cmd.getMetaDataForManagedMemberAtAbsolutePosition(pkPosition);\r\n\r\n        // *BUG*: We come here with supertype, \r\n        // thus, it should be mmd.getType().isAssignableFrom(cls)\r\n        if (cls.isAssignableFrom(mmd.getType()))\r\n        {\r\n            // User passed in the type of the field\r\n            SingularAttribute attr = (SingularAttribute) attributes.get(mmd.getName());\r\n            if (attr == null)\r\n            {\r\n                IdentifiableType supertype = getSupertype();\r\n                if (supertype != null)\r\n                {\r\n                    // Relay to the supertype\r\n                    return supertype.getId(cls);\r\n                }\r\n            }\r\n            return attr;\r\n        }\r\n...\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/datanucleus/datanucleus-api-jpa/issues/comments/230098049","html_url":"https://github.com/datanucleus/datanucleus-api-jpa/issues/26#issuecomment-230098049","issue_url":"https://api.github.com/repos/datanucleus/datanucleus-api-jpa/issues/26","id":230098049,"user":{"login":"andyjefferson","id":6105519,"avatar_url":"https://avatars.githubusercontent.com/u/6105519?v=3","gravatar_id":"","url":"https://api.github.com/users/andyjefferson","html_url":"https://github.com/andyjefferson","followers_url":"https://api.github.com/users/andyjefferson/followers","following_url":"https://api.github.com/users/andyjefferson/following{/other_user}","gists_url":"https://api.github.com/users/andyjefferson/gists{/gist_id}","starred_url":"https://api.github.com/users/andyjefferson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyjefferson/subscriptions","organizations_url":"https://api.github.com/users/andyjefferson/orgs","repos_url":"https://api.github.com/users/andyjefferson/repos","events_url":"https://api.github.com/users/andyjefferson/events{/privacy}","received_events_url":"https://api.github.com/users/andyjefferson/received_events","type":"User","site_admin":false},"created_at":"2016-07-02T11:49:10Z","updated_at":"2016-07-02T11:49:10Z","body":"Testcases are defined by http://www.datanucleus.org/documentation/problem_reporting.html as the issue template said"}}
{"actor":{"display_login":"andyjefferson"}}