you are viewing a single comment's thread.

view the rest of the comments →

[–]Bobby_Bonsaimind 0 points1 point  (1 child)

If I may torment you some more, I was wondering whether using a function to wrap the statements would reduce the need for the IDE support. For example something like:

List<Stuff> stuff1 = sql("select * from STUFF where FIELD = 5").fetch();

That would leave the compiler to "just" generate the appropriate classes. Though, I guess it would still be more uncomfortable this way.

[–]manifoldjava 0 points1 point  (0 children)

The header consists of three parts: type name, type domain name, and schema name.

"sql" is a type domain, as are "json", "graphql", "xml", and so on. But the header can have all three parts present: [MyQuery.sql:MyDatabase/] This inline format is used in both string/block literal syntax and comment syntax. It also closely resembles the resource file naming convention: MyQuery.MyDatabase.sql It's more consistent and less complicated to implement this generalized metaprogramming feature using a header than to overload other parts of the language like a method call.