{"action":"opened","issue":{"url":"https://api.github.com/repos/ebean-orm/ebean/issues/1065","repository_url":"https://api.github.com/repos/ebean-orm/ebean","labels_url":"https://api.github.com/repos/ebean-orm/ebean/issues/1065/labels{/name}","comments_url":"https://api.github.com/repos/ebean-orm/ebean/issues/1065/comments","events_url":"https://api.github.com/repos/ebean-orm/ebean/issues/1065/events","html_url":"https://github.com/ebean-orm/ebean/issues/1065","id":241043173,"number":1065,"title":"@DbEnumValue and UUID should do case insensitive comparison or type safe comparison of UUID","user":{"login":"jwaterloo","id":10145988,"avatar_url":"https://avatars1.githubusercontent.com/u/10145988?v=3","gravatar_id":"","url":"https://api.github.com/users/jwaterloo","html_url":"https://github.com/jwaterloo","followers_url":"https://api.github.com/users/jwaterloo/followers","following_url":"https://api.github.com/users/jwaterloo/following{/other_user}","gists_url":"https://api.github.com/users/jwaterloo/gists{/gist_id}","starred_url":"https://api.github.com/users/jwaterloo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwaterloo/subscriptions","organizations_url":"https://api.github.com/users/jwaterloo/orgs","repos_url":"https://api.github.com/users/jwaterloo/repos","events_url":"https://api.github.com/users/jwaterloo/events{/privacy}","received_events_url":"https://api.github.com/users/jwaterloo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-06T18:20:08Z","updated_at":"2017-07-06T18:20:08Z","closed_at":null,"body":"## Expected behavior\r\n@DbEnumValue and UUID should do case insensitive comparison or type safe comparison of UUID\r\n\r\n## Actual behavior\r\nCaused by: java.lang.IllegalArgumentException: Bean value for 7703433D-211B-41B5-9EC6-80DE55C85F47 not found in {8ca25c85-3f0a-4254-b9f1-4d4e6570bdf4=SemiMonthly, 6786c09e-f519-4821-9c37-69f6463600ed=Payment Plan, fab95ebe-0dd1-49d2-b7eb-552edea4afd2=Weekly, f810a5ac-4deb-4e65-b13c-f4a27e84a928=Monthly, 7703433d-211b-41b5-9ec6-80de55c85f47=Biweekly}\r\n\r\nNOTICE: The comparison of 7703433D-211B-41B5-9EC6-80DE55C85F47 to 7703433d-211b-41b5-9ec6-80de55c85f47 fails though they both represent the same UUID and the only difference is case.\r\n\r\n### Steps to reproduce\r\nCall code and declarations follows.\r\n\r\nPayrollHeader existing = new QPayrollHeader()\r\n\t.rows.fetchQuery()\r\n\t.policyId.eq(payrollHeader.getPolicyId())\r\n\t.policyEffectiveDate.eq(payrollHeader.getPolicyEffectiveDate())\r\n\t.reportingFrequency.eq(payrollHeader.getReportingFrequency()) //exception is here\r\n\t.payDate.eq(payrollHeader.getPayDate())\r\n\t.findUnique();\r\n\r\npublic enum ReportingFrequency {\r\n    //ANNUAL(UUID.fromString(\"5622c310-7ffc-49ba-ab1d-5ae5b29b3d9c\"), \"an_dep\", \"Annual\"),\r\n\tMONTHLY(UUID.fromString(\"f810a5ac-4deb-4e65-b13c-f4a27e84a928\"), \"mo\", \"Monthly\"),\r\n\tPAYMENT_PLAN(UUID.fromString(\"6786c09e-f519-4821-9c37-69f6463600ed\"), \"an\", \"Payment Plan\"),\r\n    //QUARTERLY(UUID.fromString(\"df202016-92ef-47be-98eb-a330837c5683\"), \"qtr\", \"Quarterly\"),\r\n    //SEMI_ANNUAL(UUID.fromString(\"3e4b736b-2048-487c-a338-ef64c9a72659\"), \"sa\", \"Semi-Annual\");\r\n\tWEEKLY(UUID.fromString(\"fab95ebe-0dd1-49d2-b7eb-552edea4afd2\"), \"w\", \"Weekly\"),\r\n\tSEMIMONTHLY(UUID.fromString(\"8ca25c85-3f0a-4254-b9f1-4d4e6570bdf4\"), \"sm\", \"SemiMonthly\"),\r\n\tBIWEEKLY(UUID.fromString(\"7703433d-211b-41b5-9ec6-80de55c85f47\"), \"biw\", \"Biweekly\");\r\n\r\n    private UUID uuid;\r\n    private String code;\r\n    private String label;\r\n\r\n    ReportingFrequency(UUID uuid, String code, String label) {\r\n        this.uuid = uuid;\r\n        this.code = code;\r\n        this.label = label;\r\n    }\r\n\r\n    @DbEnumValue\r\n    public UUID getUuid() {\r\n\t\treturn uuid;\r\n\t}\r\n\r\n\tpublic String getCode() {\r\n\t\treturn code;\r\n\t}\r\n\r\n\tpublic String getLabel() {\r\n\t\treturn label;\r\n\t}\r\n\r\n    public String toString() {\r\n    \treturn label;\r\n    }\r\n\r\n\tpublic static ReportingFrequency parse(String input) {\r\n        if (null == input) {\r\n            return null;\r\n        }\r\n        input = input.trim();\r\n        for (ReportingFrequency rf : values()) {\r\n            if (rf.uuid.toString().equalsIgnoreCase(input)    ||\r\n            \t\trf.code.equalsIgnoreCase(input) ||\r\n            \t\trf.label.equalsIgnoreCase(input)) {\r\n                return rf;\r\n            }\r\n        }\r\n        if(\"Bi-Weekly\".equalsIgnoreCase(input)) {\r\n        \treturn ReportingFrequency.BIWEEKLY;\r\n        }\r\n        return null;\r\n    }\r\n}\r\n\r\njavax.persistence.PersistenceException: Error loading on com. ... .PayrollHeader.reportingFrequency\r\n\tat io.ebeaninternal.server.query.SqlBeanLoad.load(SqlBeanLoad.java:85)\r\n\tat io.ebeaninternal.server.deploy.BeanProperty.load(BeanProperty.java:609)\r\n\tat io.ebeaninternal.server.query.SqlTreeNodeBean.load(SqlTreeNodeBean.java:280)\r\n\tat io.ebeaninternal.server.query.CQuery.readNextBean(CQuery.java:444)\r\n\tat io.ebeaninternal.server.query.CQuery.hasNext(CQuery.java:529)\r\n\tat io.ebeaninternal.server.query.CQuery.readCollection(CQuery.java:560)\r\n\tat io.ebeaninternal.server.query.CQueryEngine.findMany(CQueryEngine.java:356)\r\n\tat io.ebeaninternal.server.query.DefaultOrmQueryEngine.findMany(DefaultOrmQueryEngine.java:117)\r\n\tat io.ebeaninternal.server.core.OrmQueryRequest.findList(OrmQueryRequest.java:356)\r\n\tat io.ebeaninternal.server.core.DefaultServer.findList(DefaultServer.java:1486)\r\n\tat io.ebeaninternal.server.core.DefaultServer.findUnique(DefaultServer.java:1202)\r\n\tat io.ebeaninternal.server.querydefn.DefaultOrmQuery.findUnique(DefaultOrmQuery.java:1259)\r\n\tat io.ebean.typequery.TQRootBean.findUnique(TQRootBean.java:1196)\r\n\tat com. ... .PayrollReportController.upload(PayrollReportController.java:641)\r\n\tat com. ... .PayrollReportController.upload(PayrollReportController.java:754)\r\n...\r\nCaused by: java.lang.IllegalArgumentException: Bean value for 7703433D-211B-41B5-9EC6-80DE55C85F47 not found in {8ca25c85-3f0a-4254-b9f1-4d4e6570bdf4=SemiMonthly, 6786c09e-f519-4821-9c37-69f6463600ed=Payment Plan, fab95ebe-0dd1-49d2-b7eb-552edea4afd2=Weekly, f810a5ac-4deb-4e65-b13c-f4a27e84a928=Monthly, 7703433d-211b-41b5-9ec6-80de55c85f47=Biweekly}\r\n\tat io.ebeaninternal.server.type.EnumToDbValueMap.getBeanValue(EnumToDbValueMap.java:131)\r\n\tat io.ebeaninternal.server.type.EnumToDbStringMap.read(EnumToDbStringMap.java:40)\r\n\tat io.ebeaninternal.server.type.ScalarTypeEnumWithMapping.read(ScalarTypeEnumWithMapping.java:75)\r\n\tat io.ebeaninternal.server.deploy.BeanProperty.read(BeanProperty.java:621)\r\n\tat io.ebeaninternal.server.query.SqlBeanLoad.load(SqlBeanLoad.java:74)\r\n\t... 126 more\r\n"}}
{"actor":{"display_login":"jwaterloo"}}