My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Version_One_dot_Five  

Featured, 1.5
Updated Jun 4, 2009 by kos...@gmail.com

Version 1.5 Released!

In this version

New Features:

  • Finalized expression tree API
  • Developed an initial version of JPA provider
  • Ensured interoperability with Scala

Details

  • Expression tree API
There is a complete implementation of MS LINQ Expression Trees available at jaque.expressions namespace. Since in .Net the expression trees are built by compiler, jaque introduces LambdaExpression.parse method which takes Function as its parameter and builds the tree by means of byte code analysis.
  • JPA provider
This is a preview release of the provider. Currently it's able to perform only simple SELECTs, JOINs and AGGREGATEs. Yet a lot of interesting tests pass. Here is a simple example:
  EntityManagerFactory emf = Persistence.createEntityManagerFactory("hibernate");
  EntityManager em = emf.createEntityManager();
  JaqueEntityManager jem = new JaqueEntityManager(em);
  Queryable<Order> orders = jem.from(Order.class);

  System.out.println(count(where(new Predicate<Order>() {
	public Boolean invoke(Order t) throws Throwable {
		return t.getOrderID() > 11000;
	}
  }, orders))); //prints 77

The native SQL query hibernate produces looks this way: select count(order0_.OrderID) as col_0_0_ from Orders order0_ where order0_.OrderID>?
  • Scala interoperability
Since the technology is based on byte code analysis, it equally works with any JVM compiled language, like Scala. Indeed the following statements produce the same results as the above in Java:

  var emf = Persistence.createEntityManagerFactory("hibernate")
  var em =  emf.createEntityManager()
  var jem = new jaque.jpa.JaqueEntityManager(em)
  var orders =  jem.from(classOf[Order])
                                          
     println(count(where((o:Order) => o.orderID > 11000, orders)))
Download full sample here.

Sign in to add a comment
Powered by Google Project Hosting