{"action":"created","issue":{"url":"https://api.github.com/repos/btc-ag/redg/issues/24","repository_url":"https://api.github.com/repos/btc-ag/redg","labels_url":"https://api.github.com/repos/btc-ag/redg/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/btc-ag/redg/issues/24/comments","events_url":"https://api.github.com/repos/btc-ag/redg/issues/24/events","html_url":"https://github.com/btc-ag/redg/issues/24","id":337898809,"node_id":"MDU6SXNzdWUzMzc4OTg4MDk=","number":24,"title":"Composite Foreign Key lead to NullpointerException","user":{"login":"Ribosom","id":15702529,"node_id":"MDQ6VXNlcjE1NzAyNTI5","avatar_url":"https://avatars0.githubusercontent.com/u/15702529?v=4","gravatar_id":"","url":"https://api.github.com/users/Ribosom","html_url":"https://github.com/Ribosom","followers_url":"https://api.github.com/users/Ribosom/followers","following_url":"https://api.github.com/users/Ribosom/following{/other_user}","gists_url":"https://api.github.com/users/Ribosom/gists{/gist_id}","starred_url":"https://api.github.com/users/Ribosom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ribosom/subscriptions","organizations_url":"https://api.github.com/users/Ribosom/orgs","repos_url":"https://api.github.com/users/Ribosom/repos","events_url":"https://api.github.com/users/Ribosom/events{/privacy}","received_events_url":"https://api.github.com/users/Ribosom/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-03T13:27:14Z","updated_at":"2018-11-02T07:43:01Z","closed_at":null,"author_association":"NONE","body":"We have a foreign key like...\r\n\r\n```sql\r\nalter table A add constraint <name> foreign key(C, D) references A(C, E);\r\n```\r\n\r\nThe redG DataExtractor will throw a NullpointerException, when called like this\r\n```java\r\n        List<TableModel> allTableModels = RedG.getAllTableModels();\r\n        allTableModels.forEach(t -> t.setSqlFullName(t.getSqlName()));\r\n        List<EntityModel> entityModels = new DataExtractor().extractAllData(dataSource, allTableModels);\r\n```\r\n\r\nIf I remove the foreign key, everything works.\r\n\r\n```\r\njava.lang.NullPointerException\r\n\tat com.btc.redg.extractor.DataExtractor.lambda$findCorrectEntity$5(DataExtractor.java:212)\r\n\tat java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)\r\n\tat java.util.LinkedList$LLSpliterator.tryAdvance(LinkedList.java:1249)\r\n\tat java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)\r\n\tat java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)\r\n\tat java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)\r\n\tat java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)\r\n\tat java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)\r\n\tat java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\r\n\tat java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)\r\n\tat com.btc.redg.extractor.DataExtractor.findCorrectEntity(DataExtractor.java:220)\r\n\tat com.btc.redg.extractor.DataExtractor.resolveReferences(DataExtractor.java:143)\r\n\tat com.btc.redg.extractor.DataExtractor.extractAllData(DataExtractor.java:75)\r\n\tat com.btc.redg.extractor.DataExtractor.extractAllData(DataExtractor.java:69)\r\n```"},"comment":{"url":"https://api.github.com/repos/btc-ag/redg/issues/comments/435296996","html_url":"https://github.com/btc-ag/redg/issues/24#issuecomment-435296996","issue_url":"https://api.github.com/repos/btc-ag/redg/issues/24","id":435296996,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTI5Njk5Ng==","user":{"login":"olewehrmeyer","id":3844605,"node_id":"MDQ6VXNlcjM4NDQ2MDU=","avatar_url":"https://avatars2.githubusercontent.com/u/3844605?v=4","gravatar_id":"","url":"https://api.github.com/users/olewehrmeyer","html_url":"https://github.com/olewehrmeyer","followers_url":"https://api.github.com/users/olewehrmeyer/followers","following_url":"https://api.github.com/users/olewehrmeyer/following{/other_user}","gists_url":"https://api.github.com/users/olewehrmeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/olewehrmeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olewehrmeyer/subscriptions","organizations_url":"https://api.github.com/users/olewehrmeyer/orgs","repos_url":"https://api.github.com/users/olewehrmeyer/repos","events_url":"https://api.github.com/users/olewehrmeyer/events{/privacy}","received_events_url":"https://api.github.com/users/olewehrmeyer/received_events","type":"User","site_admin":false},"created_at":"2018-11-02T07:43:01Z","updated_at":"2018-11-02T07:43:01Z","author_association":"MEMBER","body":"@Zemke what is the status on the extra tests? Should I close this ticket and is the fix ready for merge into develop?"}}
{"actor":{"display_login":"olewehrmeyer"}}