My favorites | Sign in
Project Logo
Project hosting will be READ-ONLY Wednesday at 8am PST due to brief network maintenance.
                
People details
Project owners:
  kostat

The library provides type safe language integrated query capabilities to Java language.

Outline

JaQue provides an infrastructure for Microsoft LINQ like capabilities on Java platform. Using ASM, JaQue builds expression trees, which are used to build a query in domain specific technology or language, such as SQL. This way Java developers can focus on writing application logic in the language they know - Java, regardless what the underlying technology or language is in use. JaQue to Objects and JaQue to XML are currently supported and JaQue to JPA is under development.

Interoperability with Java Closures

The library is fully operational with upcoming java 7 closures Closures for the Java Programming Language and is actually designed to take the advantage of the new syntax. Here is how it will look like (yes, it's Java):

Iterable<? extends Number> r = 
	from(data, 
            where( { Integer i => i > 5  },
                orderBy( { Integer i1, Integer i2 => i1-i2 },
                    select( { Number i => 4 } ))));

r = from(data, 
        where( { Integer i => i > 5  },
            skip(10, 
                select( { Integer i => 4 } ))));
			
r = from(data, 
        where( { Integer i => i > 5  },
            from( { Integer i => Arrays.asList(i.toString(), i.toString()) },
                select( { String i => 4 } ))));

r = from(data, 
        where( { Integer i => i > 5  },
            orderBy( { Integer i1, Integer i2 => i1-i2 },
                groupBy( {Integer i => "a"},
                    orderBy( { Group<String, Integer> g1, Group<String, Integer> g2 => g1.getKey().compareTo(g2.getKey()) },
                        select( { Group<String, Integer> g => 4 } ))))));

In the 1.0 version (current) the syntax is different:

for (int i : where(nums, { int t => t < 2 }))
	System.out.print(i);

for (String s : select(nums, { int t => Integer.toString(t) }))
	System.out.print(s);

It was changed to be able to produce expression trees for domain specific lamguages.

To test it please follow instructions given at Closures for the Java Programming Language.









Hosted by Google Code