{"action":"reopened","issue":{"url":"https://api.github.com/repos/requery/requery/issues/484","repository_url":"https://api.github.com/repos/requery/requery","labels_url":"https://api.github.com/repos/requery/requery/issues/484/labels{/name}","comments_url":"https://api.github.com/repos/requery/requery/issues/484/comments","events_url":"https://api.github.com/repos/requery/requery/issues/484/events","html_url":"https://github.com/requery/requery/issues/484","id":216430618,"number":484,"title":"Cannot use @Generated for anything aside @Keys columns","user":{"login":"low205","id":5278910,"avatar_url":"https://avatars1.githubusercontent.com/u/5278910?v=3","gravatar_id":"","url":"https://api.github.com/users/low205","html_url":"https://github.com/low205","followers_url":"https://api.github.com/users/low205/followers","following_url":"https://api.github.com/users/low205/following{/other_user}","gists_url":"https://api.github.com/users/low205/gists{/gist_id}","starred_url":"https://api.github.com/users/low205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/low205/subscriptions","organizations_url":"https://api.github.com/users/low205/orgs","repos_url":"https://api.github.com/users/low205/repos","events_url":"https://api.github.com/users/low205/events{/privacy}","received_events_url":"https://api.github.com/users/low205/received_events","type":"User","site_admin":false},"labels":[{"id":286505770,"url":"https://api.github.com/repos/requery/requery/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-03-23T13:39:38Z","updated_at":"2017-04-11T04:17:12Z","closed_at":null,"body":"When entity has generated column(virtual column in oracle for examle), you cannot use it in INSERT, but you can't mark coluwn with `@Generated`. \r\n\r\nThere is this code in InsertGenerator:\r\n```\r\n                       Expression<?> key = value.getKey();\r\n                        switch (key.getExpressionType()) {\r\n                            case ATTRIBUTE:\r\n                                Attribute attribute = (Attribute) key;\r\n                                if (attribute.isGenerated()) {\r\n                                    throw new IllegalStateException();\r\n                                }\r\n                                qb.attribute(attribute);\r\n                                break;\r\n                            default:\r\n                                qb.append(key.getName()).space();\r\n                                break;\r\n                        }\r\n```\r\n\r\nwhich throws this:\r\n```\r\njava.lang.IllegalStateException\r\n\tat io.requery.sql.gen.InsertGenerator$1.append(InsertGenerator.java:57)\r\n\tat io.requery.sql.gen.InsertGenerator$1.append(InsertGenerator.java:49)\r\n\tat io.requery.sql.QueryBuilder.commaSeparated(QueryBuilder.java:248)\r\n\tat io.requery.sql.QueryBuilder.commaSeparated(QueryBuilder.java:235)\r\n\tat io.requery.sql.gen.InsertGenerator.write(InsertGenerator.java:48)\r\n\tat io.requery.sql.gen.InsertGenerator.write(InsertGenerator.java:32)\r\n\tat io.requery.sql.gen.StatementGenerator.write(StatementGenerator.java:69)\r\n\tat io.requery.sql.gen.DefaultOutput.toSql(DefaultOutput.java:97)\r\n\tat io.requery.sql.EntityUpdateOperation$1.evaluate(EntityUpdateOperation.java:47)\r\n\tat io.requery.sql.EntityUpdateOperation$1.evaluate(EntityUpdateOperation.java:40)\r\n\tat io.requery.query.BaseScalar.value(BaseScalar.java:48)\r\n\tat io.requery.sql.EntityWriter.insert(EntityWriter.java:441)\r\n\tat io.requery.sql.EntityWriter.insert(EntityWriter.java:401)\r\n\tat io.requery.sql.EntityDataStore.insert(EntityDataStore.java:204)\r\n\tat io.requery.sql.EntityDataStore.insert(EntityDataStore.java:190)\r\n```"}}
{"actor":{"display_login":"npurushe"}}