{"action":"created","issue":{"url":"https://api.github.com/repos/modelmapper/modelmapper/issues/68","repository_url":"https://api.github.com/repos/modelmapper/modelmapper","labels_url":"https://api.github.com/repos/modelmapper/modelmapper/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/modelmapper/modelmapper/issues/68/comments","events_url":"https://api.github.com/repos/modelmapper/modelmapper/issues/68/events","html_url":"https://github.com/modelmapper/modelmapper/issues/68","id":18954868,"node_id":"MDU6SXNzdWUxODk1NDg2OA==","number":68,"title":"Mutliple id matching issue","user":{"login":"syedshahul","id":2841333,"node_id":"MDQ6VXNlcjI4NDEzMzM=","avatar_url":"https://avatars3.githubusercontent.com/u/2841333?v=4","gravatar_id":"","url":"https://api.github.com/users/syedshahul","html_url":"https://github.com/syedshahul","followers_url":"https://api.github.com/users/syedshahul/followers","following_url":"https://api.github.com/users/syedshahul/following{/other_user}","gists_url":"https://api.github.com/users/syedshahul/gists{/gist_id}","starred_url":"https://api.github.com/users/syedshahul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syedshahul/subscriptions","organizations_url":"https://api.github.com/users/syedshahul/orgs","repos_url":"https://api.github.com/users/syedshahul/repos","events_url":"https://api.github.com/users/syedshahul/events{/privacy}","received_events_url":"https://api.github.com/users/syedshahul/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2013-09-04T06:10:45Z","updated_at":"2018-08-16T09:55:37Z","closed_at":"2018-08-16T09:55:37Z","author_association":"NONE","body":"===== **POJO** =====\r\n\r\n```java\r\n    // Company POJO\r\n         @JsonInclude(JsonInclude.Include.NON_NULL)\r\n         @JsonNaming(PropertyNamingStrategy\r\n.LowerCaseWithUnderscoresStrategy.class)\r\n         public class Company implements Serializable {\r\n           private Integer id;\r\n           private Integer registrationId;\r\n           private String name;\r\n           // assume getters ,setters and serializable implementations.\r\n         }\r\n\r\n    // EmployeeVO POJO\r\n         @JsonInclude(JsonInclude.Include.NON_NULL)\r\n         @JsonNaming(PropertyNamingStrategy\r\n.LowerCaseWithUnderscoresStrategy.class)\r\n         public class EmployeeVO implements Serializable {\r\n           private Integer id;\r\n           private String name;\r\n           private BigDecimal salary;\r\n           private Company company;\r\n\r\n           // assume getters ,setters and serializable implementations.\r\n         }\r\n```\r\n\r\n===== **My DAO layer class** =====\r\n\r\n```java\r\n    public List<EmployeeVO> getEmployees(){     \r\n        // configuring model mapper.\r\n           ModelMapper modelMapper = new ModelMapper();\r\n           modelMapper.getConfiguration()\r\n                      .addValueReader(new CustomizedRecordValueReader())\r\n                  .setSourceNameTokenizer(NameTokenizers.UNDERSCORE);\r\n\r\n        //property map configuration.\r\n          PropertyMap<Record, EmployeeVO> employeeVOMap =\r\n new PropertyMap<Record, EmployeeVO>() {\r\n           protected void configure() {\r\n// emp_id, name, salary,  comp_id, comp_name, comp_registration_id\r\n              map().setName(this.<String>source(\"name\"));\r\n              map().setId(this.<Integer>source(\"emp_id\"));\r\n              map().setSalary(this.<BigDecimal>source(\"salary\"));\r\n              map().getCompany()\r\n.setName(this.<String>source(\"comp_name\"));\r\n              map().getCompany()\r\n.setId(this.<String>source(\"comp_id\"));\r\n map().getCompany()\r\n.seRegistrationId(this.<String>source(\"comp_registration_id\"));\r\n            }\r\n         };\r\n        // TypeMap config\r\n        modelMapper.createTypeMap(Record.class, EmployeeVO.class);\r\n        // adding employeeVOMap .\r\n        modelMapper.addMappings(employeeVOMap);         \r\n\r\n    // JOOQ query  \r\n        List<Field<?>> fields = Lists.newArrayList();  \r\n        //  fields includes emp_id, name, salary,  \r\n//comp_id, comp_name, comp_registration_Id\r\n\r\n        SelectJoinStep query = select(dslContext, fields)\r\n.from(EMPLOYEE).join(COMPANY)\r\n.on(COMPANY.ID.equal(EMPLOYEE.COMPANY_ID));  \r\n\r\n            Result<Record> records = query.fetch();\r\n\r\n        Record record = null;\r\n            Iterator<Record> it = records.iterator();\r\n            List<EmployeeVO> employeeList=  Lists.newArrayList();\r\n            while (it.hasNext()) {\r\n                record = it.next();\r\n\r\n                EmployeeVO employeeVOObj =\r\n                        modelMapper.map(record, EmployeeVO.class);\r\n                employeeList.add(employeeVOObj);\r\n            }\r\n        return employeeList;    \r\n    }\r\n```\r\n\r\n===== **Issue** =====\r\n\r\nIssue in getting the right data for the all the id properties, other data I am getting. \r\nAny help?\r\n\r\n**Note:** \r\nI am using CustomizedRecordValueReader as your RecordValueReader converts the member name to uppercase, which failed in my case.\r\n"},"comment":{"url":"https://api.github.com/repos/modelmapper/modelmapper/issues/comments/413490586","html_url":"https://github.com/modelmapper/modelmapper/issues/68#issuecomment-413490586","issue_url":"https://api.github.com/repos/modelmapper/modelmapper/issues/68","id":413490586,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzQ5MDU4Ng==","user":{"login":"chhsiao90","id":10794200,"node_id":"MDQ6VXNlcjEwNzk0MjAw","avatar_url":"https://avatars2.githubusercontent.com/u/10794200?v=4","gravatar_id":"","url":"https://api.github.com/users/chhsiao90","html_url":"https://github.com/chhsiao90","followers_url":"https://api.github.com/users/chhsiao90/followers","following_url":"https://api.github.com/users/chhsiao90/following{/other_user}","gists_url":"https://api.github.com/users/chhsiao90/gists{/gist_id}","starred_url":"https://api.github.com/users/chhsiao90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chhsiao90/subscriptions","organizations_url":"https://api.github.com/users/chhsiao90/orgs","repos_url":"https://api.github.com/users/chhsiao90/repos","events_url":"https://api.github.com/users/chhsiao90/events{/privacy}","received_events_url":"https://api.github.com/users/chhsiao90/received_events","type":"User","site_admin":false},"created_at":"2018-08-16T09:55:37Z","updated_at":"2018-08-16T09:55:37Z","author_association":"MEMBER","body":"Create #385 for id mapping issues."}}
{"actor":{"display_login":"chhsiao90"}}