News for hackers. Stuff that matters.
Re:Java Feature Spotlight: Text Blocks by stickfigure on Friday May 01, 2020 @09:40AM (#23041864)
I whine about (lack of) text blocks every day when editing multiline SQL statements. The extra quotes and +s and spaces are really irritating.
Re:Java Feature Spotlight: Text Blocks by vips7L on Friday May 01, 2020 @09:59AM (#23042027)
Maybe I'm lucky but this is infrequent for me. There are better tools for most queries:

https://ebean.io/docs/query/background/typesafe

https://www.jooq.org/

http://www.querydsl.com/

https://scala-slick.org/

Re:Java Feature Spotlight: Text Blocks by stickfigure on Friday May 01, 2020 @08:11PM (#23047800)
I find these tools only work well for simple queries. For anything complicated, you spend N units of time figuring out how to make the query, then 4N units of time figuring out how to represent it in the metalanguage (often hacking around it with custom functions and operators).

They are especially bad with exotic operators like postgres' JSONB columns. I ended up ripping jooq out of an app over this.

There's an argument that they bring type safety to SQL, but Intellij actually validates your string literal SQL against the schema, so the benefit is marginal.

Re:Java Feature Spotlight: Text Blocks by noisem4ker on Friday May 01, 2020 @10:37AM (#23042385)
If you're using JPA, add the Criteria API to the list.
Re:Java Feature Spotlight: Text Blocks by bootlooped on Friday May 01, 2020 @09:44AM (#23041905)
At a previous job we started using Groovey files to store queries because of this.