{"action":"created","issue":{"url":"https://api.github.com/repos/jdbi/jdbi/issues/333","repository_url":"https://api.github.com/repos/jdbi/jdbi","labels_url":"https://api.github.com/repos/jdbi/jdbi/issues/333/labels{/name}","comments_url":"https://api.github.com/repos/jdbi/jdbi/issues/333/comments","events_url":"https://api.github.com/repos/jdbi/jdbi/issues/333/events","html_url":"https://github.com/jdbi/jdbi/issues/333","id":151685893,"number":333,"title":"@Define doesn't appear to work for @SqlQuery for table name","user":{"login":"pennstatephil","id":2266060,"avatar_url":"https://avatars.githubusercontent.com/u/2266060?v=3","gravatar_id":"","url":"https://api.github.com/users/pennstatephil","html_url":"https://github.com/pennstatephil","followers_url":"https://api.github.com/users/pennstatephil/followers","following_url":"https://api.github.com/users/pennstatephil/following{/other_user}","gists_url":"https://api.github.com/users/pennstatephil/gists{/gist_id}","starred_url":"https://api.github.com/users/pennstatephil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pennstatephil/subscriptions","organizations_url":"https://api.github.com/users/pennstatephil/orgs","repos_url":"https://api.github.com/users/pennstatephil/repos","events_url":"https://api.github.com/users/pennstatephil/events{/privacy}","received_events_url":"https://api.github.com/users/pennstatephil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-28T16:24:42Z","updated_at":"2016-04-28T16:29:57Z","closed_at":null,"body":"I've seen `@Define` used successfully in `@SqlUpdate` statements, but not `@SqlQuery` when referring to a table name. I haven't been able to implement it successfully in a query, and my gut feel is that it's because of the Query/Update difference."},"comment":{"url":"https://api.github.com/repos/jdbi/jdbi/issues/comments/215486309","html_url":"https://github.com/jdbi/jdbi/issues/333#issuecomment-215486309","issue_url":"https://api.github.com/repos/jdbi/jdbi/issues/333","id":215486309,"user":{"login":"pennstatephil","id":2266060,"avatar_url":"https://avatars.githubusercontent.com/u/2266060?v=3","gravatar_id":"","url":"https://api.github.com/users/pennstatephil","html_url":"https://github.com/pennstatephil","followers_url":"https://api.github.com/users/pennstatephil/followers","following_url":"https://api.github.com/users/pennstatephil/following{/other_user}","gists_url":"https://api.github.com/users/pennstatephil/gists{/gist_id}","starred_url":"https://api.github.com/users/pennstatephil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pennstatephil/subscriptions","organizations_url":"https://api.github.com/users/pennstatephil/orgs","repos_url":"https://api.github.com/users/pennstatephil/repos","events_url":"https://api.github.com/users/pennstatephil/events{/privacy}","received_events_url":"https://api.github.com/users/pennstatephil/received_events","type":"User","site_admin":false},"created_at":"2016-04-28T16:29:57Z","updated_at":"2016-04-28T16:29:57Z","body":"example code:\r\n\r\n```\r\n    private static final String getKnownLineCountByMessageIdQuery =\r\n            \"select coalesce(\\n\" +\r\n                    \"    ( select count( message_id ) from <tableName>\\n\" +\r\n                    \"    group by message_id\\n\" +\r\n                    \"    having message_id = ':messageId' )\\n\" +\r\n                    \"    , 0 ) as count;\";\r\n\r\n    @SqlQuery( getKnownLineCountByMessageIdQuery )\r\n    protected abstract int getKnownLineCountByMessageId( @Define( \"tableName\" ) String tableName,\r\n                                                                @Bind( \"messageId\" ) String messageId );\r\n\r\n    public int getInventoryHistoryCountByMessageId( String messageId )\r\n    {\r\n        return getKnownLineCountByMessageId( \"inventory_history_message\", messageId );\r\n    }\r\n\r\n    public int getInboundShipmentCountByMessageId( String messageId )\r\n    {\r\n        return getKnownLineCountByMessageId( \"inbound_shipment_message\", messageId );\r\n    }\r\n\r\n    public int getParcelManifestCountByMessageId( String messageId )\r\n    {\r\n        return getKnownLineCountByMessageId( \"parcel_manifest_message\", messageId );\r\n    }\r\n```\r\nand the class is indeed annotated with `@UseStringTemplate3StatementLocator`"}}