Show HN: Writing SQL expressions using Java syntax
1–10 of 14 posts
Re: Show HN: Writing SQL expressions using Java syntax
#2Features:
1. With one annotation your Class has fully featured capabilities of SQL programming
2. Easy to relational(has_one, has_many and beglongs_to) query and paged query
3. Writing SQL expressions(arithmetic, comparison and logical) using Java syntax
Re: Show HN: Writing SQL expressions using Java syntax
#3Re: Show HN: Writing SQL expressions using Java syntax
#4Re: Show HN: Writing SQL expressions using Java syntax
#5How does it compare to JOOQ? https://github.com/jooq/jooq
Re: Show HN: Writing SQL expressions using Java syntax
#6ObjectiveSQL is an ORM framework in Java based on ActiveRecord pattern, which encourages rapid development and clean, codes with the least, and convention over configuration. Features: 1. With one annotation your Class has fully featured capabilities of SQL programming 2. Easy to relational(has_one, has_many and beglongs_to) query and paged query 3. Writing SQL expressions(arithmetic, comparison and logical) using Ja…
Re: Show HN: Writing SQL expressions using Java syntax
#7Re: Show HN: Writing SQL expressions using Java syntax
#8How does this work? I thought Java didn't have operator overloading. Are expressions represented as numbers somehow??
Re: Show HN: Writing SQL expressions using Java syntax
#9`select.project(sum(orderTable.amount) / sum(orderTable.quantity) * 100)` How does this work? I thought Java didn't have operator overloading. Are expressions represented as numbers somehow??
They are rarely used in java ecosystem and have a reputation for being fragile - I haven't tested whether this particular one for edge cases though.
[1] https://github.com/braisdom/ObjectiveSql/blob/master/core/sr...
Re: Show HN: Writing SQL expressions using Java syntax
#10`select.project(sum(orderTable.amount) / sum(orderTable.quantity) * 100)` How does this work? I thought Java didn't have operator overloading. Are expressions represented as numbers somehow??
They use a java compiler plugin [1] (hence the need for IDE plugin). So you are writing java syntax but the code is not really java. They are rarely used in java ecosystem and have a reputation for being fragile - I haven't tested whether this particular one for edge cases though. [1] https://github.com/braisdom/ObjectiveSql/blob/master/core/sr...
A way to look at Graal is, "better Java compiler plugins."
Some stuff, like using checked exceptions as a function type system, is fragile.
Code weaving was always sort of the future. Look at the Javascript ecosystem. It's unavoidable. Not necessarily bad.
Anyway ObjectiveSQL should probably use an annotationProcessor to achieve the code weaving goals. Similar to Dagger.