{"action":"created","issue":{"url":"https://api.github.com/repos/jOOQ/jOOQ/issues/6158","repository_url":"https://api.github.com/repos/jOOQ/jOOQ","labels_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/6158/labels{/name}","comments_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/6158/comments","events_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/6158/events","html_url":"https://github.com/jOOQ/jOOQ/issues/6158","id":224410646,"number":6158,"title":"got failed when alias column name","user":{"login":"zzsoszz","id":3824958,"avatar_url":"https://avatars0.githubusercontent.com/u/3824958?v=3","gravatar_id":"","url":"https://api.github.com/users/zzsoszz","html_url":"https://github.com/zzsoszz","followers_url":"https://api.github.com/users/zzsoszz/followers","following_url":"https://api.github.com/users/zzsoszz/following{/other_user}","gists_url":"https://api.github.com/users/zzsoszz/gists{/gist_id}","starred_url":"https://api.github.com/users/zzsoszz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zzsoszz/subscriptions","organizations_url":"https://api.github.com/users/zzsoszz/orgs","repos_url":"https://api.github.com/users/zzsoszz/repos","events_url":"https://api.github.com/users/zzsoszz/events{/privacy}","received_events_url":"https://api.github.com/users/zzsoszz/received_events","type":"User","site_admin":false},"labels":[{"id":9935131,"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/C:%20Functionality","name":"C: Functionality","color":"0000aa","default":false},{"id":9935166,"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/P:%20Medium","name":"P: Medium","color":"ffaaaa","default":false},{"id":9935130,"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/T:%20Defect","name":"T: Defect","color":"cccccc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/jOOQ/jOOQ/milestones/132","html_url":"https://github.com/jOOQ/jOOQ/milestone/132","labels_url":"https://api.github.com/repos/jOOQ/jOOQ/milestones/132/labels","id":1767107,"number":132,"title":"Version 3.10.0","description":"","creator":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars1.githubusercontent.com/u/734593?v=3","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"open_issues":557,"closed_issues":235,"state":"open","created_at":"2016-05-15T17:12:51Z","updated_at":"2017-04-26T10:36:09Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2017-04-26T09:56:58Z","updated_at":"2017-04-26T10:36:09Z","closed_at":"2017-04-26T10:36:09Z","body":"-https://github.com/jOOQ/jOOQ/issues/4512\r\n\r\ngot failed when alias column name on h2database\r\n\r\njava code\r\n```java\r\nJdbcMapper<Tuple2<AuthorRecord, List<BookRecord>>> mapper = \r\n\t    JdbcMapperFactory\r\n\t        .newInstance()\r\n\t        .addKeys(\"id\")\r\n\t        .newMapper(new TypeReference<Tuple2<AuthorRecord, List<BookRecord>>>() {});\r\n\t\ttry (ResultSet rs =\r\n\t\t         ctx\r\n\t\t            .select()\r\n\t\t            .from(AUTHOR).leftJoin(BOOK.as(\"v1\",field->\"AUTHOR_\"+field.getName())).on(BOOK.AUTHOR_ID.eq(AUTHOR.ID))\r\n\t\t            .orderBy(AUTHOR.ID)\r\n\t\t            .fetchResultSet()) {\r\n\t\t\tStream<Tuple2<AuthorRecord, List<BookRecord>>> stream = mapper.stream(rs);\r\n\t\t\tstream.forEach(one->{\r\n\t\t\t\tSystem.out.println(one.v1);\r\n\t\t\t});\r\n\t\t}\r\n```\r\n\r\ngenerated sql \r\n\r\n```sql\r\nSELECT\r\n    \"FLYWAY_TEST\" . \"AUTHOR\" . \"ID\",\r\n    \"FLYWAY_TEST\" . \"AUTHOR\" . \"FIRST_NAME\",\r\n    \"FLYWAY_TEST\" . \"AUTHOR\" . \"LAST_NAME\",\r\n    \"FLYWAY_TEST\" . \"AUTHOR\" . \"DATE_OF_BIRTH\",\r\n    \"FLYWAY_TEST\" . \"AUTHOR\" . \"YEAR_OF_BIRTH\",\r\n    \"FLYWAY_TEST\" . \"AUTHOR\" . \"ADDRESS\",\r\n    \"FLYWAY_TEST\" . \"AUTHOR\" . \"CREATEDATE\",\r\n    \"v1\" . \"AUTHOR_ID\",\r\n    \"v1\" . \"AUTHOR_AUTHOR_ID\",\r\n    \"v1\" . \"AUTHOR_TITLE\",\r\n    \"v1\" . \"AUTHOR_CREATEDATE\"\r\nFROM\r\n    **\"FLYWAY_TEST\" . \"AUTHOR\" LEFT OUTER JOIN \"FLYWAY_TEST\" . \"BOOK\" \"v1\"(\r\n        \"AUTHOR_ID\",\r\n        \"AUTHOR_AUTHOR_ID\",\r\n        \"AUTHOR_TITLE\",\r\n        \"AUTHOR_CREATEDATE\"\r\n    )**(h2database not supported this syntax)\r\n        ON \"FLYWAY_TEST\" . \"BOOK\" . \"AUTHOR_ID\" = \"FLYWAY_TEST\" . \"AUTHOR\" . \"ID\"\r\nORDER BY\r\n    \"FLYWAY_TEST\" . \"AUTHOR\" . \"ID\" ASC\r\n```\r\n\r\n\r\n\r\ngot Exception\r\n```java\r\norg.h2.jdbc.JdbcSQLException: Syntax error in SQL statement \"SELECT \"\"FLYWAY_TEST\"\".\"\"AUTHOR\"\".\"\"ID\"\", \"\"FLYWAY_TEST\"\".\"\"AUTHOR\"\".\"\"FIRST_NAME\"\", \"\"FLYWAY_TEST\"\".\"\"AUTHOR\"\".\"\"LAST_NAME\"\", \"\"FLYWAY_TEST\"\".\"\"AUTHOR\"\".\"\"DATE_OF_BIRTH\"\", \"\"FLYWAY_TEST\"\".\"\"AUTHOR\"\".\"\"YEAR_OF_BIRTH\"\", \"\"FLYWAY_TEST\"\".\"\"AUTHOR\"\".\"\"ADDRESS\"\", \"\"FLYWAY_TEST\"\".\"\"AUTHOR\"\".\"\"CREATEDATE\"\", \"\"v1\"\".\"\"AUTHOR_ID\"\", \"\"v1\"\".\"\"AUTHOR_AUTHOR_ID\"\", \"\"v1\"\".\"\"AUTHOR_TITLE\"\", \"\"v1\"\".\"\"AUTHOR_CREATEDATE\"\" FROM \"\"FLYWAY_TEST\"\".\"\"AUTHOR\"\" LEFT OUTER JOIN \"\"FLYWAY_TEST\"\".\"\"BOOK\"\" \"\"v1\"\"([*]\"\"AUTHOR_ID\"\", \"\"AUTHOR_AUTHOR_ID\"\", \"\"AUTHOR_TITLE\"\", \"\"AUTHOR_CREATEDATE\"\") ON \"\"FLYWAY_TEST\"\".\"\"BOOK\"\".\"\"AUTHOR_ID\"\" = \"\"FLYWAY_TEST\"\".\"\"AUTHOR\"\".\"\"ID\"\" ORDER BY \"\"FLYWAY_TEST\"\".\"\"AUTHOR\"\".\"\"ID\"\" ASC \"; SQL statement:\r\nselect \"FLYWAY_TEST\".\"AUTHOR\".\"ID\", \"FLYWAY_TEST\".\"AUTHOR\".\"FIRST_NAME\", \"FLYWAY_TEST\".\"AUTHOR\".\"LAST_NAME\", \"FLYWAY_TEST\".\"AUTHOR\".\"DATE_OF_BIRTH\", \"FLYWAY_TEST\".\"AUTHOR\".\"YEAR_OF_BIRTH\", \"FLYWAY_TEST\".\"AUTHOR\".\"ADDRESS\", \"FLYWAY_TEST\".\"AUTHOR\".\"CREATEDATE\", \"v1\".\"AUTHOR_ID\", \"v1\".\"AUTHOR_AUTHOR_ID\", \"v1\".\"AUTHOR_TITLE\", \"v1\".\"AUTHOR_CREATEDATE\" from \"FLYWAY_TEST\".\"AUTHOR\" left outer join \"FLYWAY_TEST\".\"BOOK\" \"v1\"(\"AUTHOR_ID\", \"AUTHOR_AUTHOR_ID\", \"AUTHOR_TITLE\", \"AUTHOR_CREATEDATE\") on \"FLYWAY_TEST\".\"BOOK\".\"AUTHOR_ID\" = \"FLYWAY_TEST\".\"AUTHOR\".\"ID\" order by \"FLYWAY_TEST\".\"AUTHOR\".\"ID\" asc [42000-193]\r\n\tat org.h2.message.DbException.getJdbcSQLException(DbException.java:345)\r\n\tat org.h2.message.DbException.get(DbException.java:179)\r\n\tat org.h2.message.DbException.get(DbException.java:155)\r\n\tat org.h2.message.DbException.getSyntaxError(DbException.java:191)\r\n\tat org.h2.command.Parser.getSyntaxError(Parser.java:530)\r\n\tat org.h2.command.Parser.prepareCommand(Parser.java:257)\r\n\tat org.h2.engine.Session.prepareLocal(Session.java:561)\r\n\tat org.h2.engine.Session.prepareCommand(Session.java:502)\r\n\tat org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1203)\r\n\tat org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:73)\r\n\tat org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:287)\r\n\tat net.sf.log4jdbc.ConnectionSpy.prepareStatement(ConnectionSpy.java:388)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\r\n\tat java.lang.reflect.Method.invoke(Unknown Source)\r\n\tat org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)\r\n\tat org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108)\r\n\tat org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:81)\r\n\tat com.sun.proxy.$Proxy82.prepareStatement(Unknown Source)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\r\n\tat java.lang.reflect.Method.invoke(Unknown Source)\r\n\tat org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:240)\r\n\tat com.sun.proxy.$Proxy83.prepareStatement(Unknown Source)\r\n\tat org.jooq.impl.ProviderEnabledConnection.prepareStatement(ProviderEnabledConnection.java:112)\r\n\tat org.jooq.impl.SettingsEnabledConnection.prepareStatement(SettingsEnabledConnection.java:76)\r\n\tat org.jooq.impl.AbstractResultQuery.prepare(AbstractResultQuery.java:232)\r\n\tat org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:321)\r\n\tat org.jooq.impl.AbstractResultQuery.fetchLazy(AbstractResultQuery.java:368)\r\n\tat org.jooq.impl.AbstractResultQuery.fetchLazy(AbstractResultQuery.java:355)\r\n\tat org.jooq.impl.AbstractResultQuery.fetchResultSet(AbstractResultQuery.java:321)\r\n\tat org.jooq.impl.SelectImpl.fetchResultSet(SelectImpl.java:2713)\r\n\tat io.swagger.service.ActivityService.findByCategory(ActivityService.java:60)\r\n\tat io.swagger.service.ActivityService$$FastClassBySpringCGLIB$$280d3621.invoke(<generated>)\r\n\tat org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)\r\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)\r\n\tat org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)\r\n\tat org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)\r\n\tat org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)\r\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)\r\n\tat org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)\r\n\tat io.swagger.service.ActivityService$$EnhancerBySpringCGLIB$$5c8fd128.findByCategory(<generated>)\r\n\tat io.swagger.Swagger2SpringBoot.onApplicationEvent(Swagger2SpringBoot.java:254)\r\n\tat io.swagger.Swagger2SpringBoot.onApplicationEvent(Swagger2SpringBoot.java:1)\r\n\tat io.swagger.Swagger2SpringBoot$$EnhancerBySpringCGLIB$$77bfc77b.onApplicationEvent(<generated>)\r\n\tat org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:166)\r\n\tat org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138)\r\n\tat org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:383)\r\n\tat org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:337)\r\n\tat org.springframework.boot.context.event.EventPublishingRunListener.finished(EventPublishingRunListener.java:93)\r\n\tat org.springframework.boot.SpringApplicationRunListeners.callFinishedListener(SpringApplicationRunListeners.java:79)\r\n\tat org.springframework.boot.SpringApplicationRunListeners.finished(SpringApplicationRunListeners.java:72)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:317)\r\n\tat io.swagger.Swagger2SpringBoot.main(Swagger2SpringBoot.java:221)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\r\n\tat java.lang.reflect.Method.invoke(Unknown Source)\r\n\tat org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/jOOQ/jOOQ/issues/comments/297345467","html_url":"https://github.com/jOOQ/jOOQ/issues/6158#issuecomment-297345467","issue_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/6158","id":297345467,"user":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars1.githubusercontent.com/u/734593?v=3","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"created_at":"2017-04-26T10:36:09Z","updated_at":"2017-04-26T10:36:09Z","body":"Hmm, are you sure your `ctx` is correctly configured with the `SQLDialect.H2`? Derived column lists should be emulated correctly on H2 using the trick at the bottom of:\r\nhttps://blog.jooq.org/2013/01/07/simulating-the-sql-standard\r\n\r\nBy the way, your `on()` clause is wrong. Since you're renaming both the `BOOK` table and its columns, you must use the renamed column `\"v1\".\"AUTHOR_ID\"` instead of the original, fully qualified `\"FLYWAY_TEST\" . \"BOOK\" . \"AUTHOR_ID\"`.\r\n\r\nIn that case, it works for me..."}}
{"actor":{"display_login":"lukaseder"}}