embedding JPQL in a typesafe manner [message #610584] |
Tue, 01 July 2008 14:12 |
Miguel Garcia Messages: 77 Registered: July 2009 |
Member |
|
|
Hi,
I'm exploring the pros and cons of embedded query languages (JPQL, LINQ) in
a typesafe manner (to detect misspellings at compile-time, check type
agreement between operands in WHERE clauses) and I was wondering whether
other Dali users are also working on that.
In a nutshell, such embeddings allow writing code similar to this [1]
List<Tuple3<String, Integer, Date>> rows =
new QueryBuilder(datasource)
.from(p)
.where(gt(p.height, 170))
.select(p.name, p.height, p.birthday)
.list();
but with an API generated automatically from an Ecore metamodel (
http://bugs.eclipse.org/234003 ) instead of one manually built as in the
example above.
It would be great to hear from others also working in this area.
Miguel
http://www.sts.tu-harburg.de/~mi.garcia/
References:
[1] Embedded Typesafe Domain Specific Languages for Java
Jevgeni Kabanov, Rein Raudj
|
|
|
Powered by
FUDForum. Page generated in 0.03031 seconds