厌倦了蹩脚的 sql,正在构思替代方案,碰巧遇到这个,挺有意思。
http://www.h2database.com/html/frame.html?jaqu.html&main
[quote]
JaQu stands for Java Query and allows to access databases using pure Java. JaQu replaces SQL, JDBC, and O/R frameworks such as Hibernate. JaQu is something like LINQ for Java (LINQ stands for "language integrated query" and is a Microsoft .NET technology). The following JaQu code:
Product p = new Product();
List<Product> soldOutProducts =
db.from(p).where(p.unitsInStock).is(0).select();
stands for the SQL statement:
SELECT * FROM PRODUCTS P
WHERE P.UNITS_IN_STOCK = 0
[/quote]
http://www.h2database.com/html/frame.html?jaqu.html&main
[quote]
JaQu stands for Java Query and allows to access databases using pure Java. JaQu replaces SQL, JDBC, and O/R frameworks such as Hibernate. JaQu is something like LINQ for Java (LINQ stands for "language integrated query" and is a Microsoft .NET technology). The following JaQu code:
Product p = new Product();
List<Product> soldOutProducts =
db.from(p).where(p.unitsInStock).is(0).select();
stands for the SQL statement:
SELECT * FROM PRODUCTS P
WHERE P.UNITS_IN_STOCK = 0
[/quote]