4 ms·
Java doesn't add features unless they're absolutely sure they want to support it for eternity and for something like text blocks why take the risk unless you're
by vips7L 7y ago
Java doesn't add features unless they're absolutely sure they want to support it for eternity and for something like text blocks why take the risk unless you're absolutely sure? Text blocks aren't something I see myself even using frequently.
- stickfigure 7y agoI whine about (lack of) text blocks every day when editing multiline SQL statements. The extra quotes and +s and spaces are really irritating.
- bootlooped 7y agoAt a previous job we started using Groovey files to store queries because of this.
- vips7L 7y agoMaybe I'm lucky but this is infrequent for me. There are better tools for most queries: https://ebean.io/docs/query/background/typesafe https://ebean.io/docs/query/background/typesafe https://www.jooq.org/ https://www.jooq.org/ http://www.querydsl.com/ http://www.querydsl.com/ https://scala-slick.org/ https://scala-slick.org/
- noisem4ker 7y agoIf you're using JPA, add the Criteria API to the list.
- stickfigure 7y agoI 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.