Hi Sonya, Do you mean the ability to specify a path to a resource instead of an SQL query in the @SqlQuery annotation? This is a feature of the default statement locator in Jdbi2. It tries to guess whether the the string is an SQL query of a path. The relevant part is something here: https://github.com/jdbi/jdbi/blob/jdbi2/src/main/java/org/skife/jdbi/v2/ClasspathStatementLocator.java#L126. It has been changed in Jdbi3 (if you want to load a resource you need to explicitly add a @UseClasspathSqlLocator annotation: http://jdbi.org/#_sqllocator
Artem Am Mittwoch, 21. Februar 2018 00:05:33 UTC+1 schrieb [email protected]: > > Hi Dropwizard User Group, > > I had a question regarding the dropwizard-jbi implementation. > I have read the dependency enables a developer to write a DAO query method > and attach the underlying sql to a separate .sql resource file (as opposed > to using the @Query annotation and writing SQL query inline in the same > java file) > For example, my UserDao class file would have a findByName method. There > will be a corresponding findByName.sql file that would hold the actual > underlying sql query. > > Could someone point to the exact location where this occurs? I am assuming > its using reflection under the hood as a utility. I am trying to write a > POC with spring boot and JDBI and would love to incorporate something > similar to enable writing queries in resource files versus inline in the > source code. > > Thanks > Sonya > -- You received this message because you are subscribed to the Google Groups "dropwizard-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
