torsdag, september 14, 2006

Hierarchical Questions Using TopLink

A colleague asked about how one can implement hierarchical questions using TopLink. There is a section in the manual describing this nicely.

The URL to the section is:
http://www.oracle.com/technology/products/ias/toplink/doc/1013/MAIN/_html/qryadv008.htm#i1134801

The following code snippet is an excerpt from it:

ReadAllQuery raq = new ReadAllQuery(Employee.class);
Expression startExpr = expressionBuilder.get("id").equal(new Integer(1));
Expression connectBy = expressionBuilder.get("managedEmployees");
Vector order = new Vector();
order.addElement(expressionBuilder.get("lastName"));
order.addElement(expressionBuilder.get("firstName"));
raq.setHierarchicalQueryClause(startExpr, connectBy, order);
Vector employees = uow.executeQuery(raq);


this will generate the following SQL:

SELECT * FROM EMPLOYEE START WITH ID=1 CONNECT BY PRIOR ID=MANAGER_ID ORDER SIBLINGS BY LAST_NAME, FIRST_NAME

onsdag, september 13, 2006

JDeveloper 10.1.3 ServiceUpdate 5 Available

A new Service Update for JDeveloper 10.1.3 is available via "Check for Updates".

Please note that this is not applicable for the JDeveloper 10.1.3.1 Developer Preview.

This is the fifth Service Update (SU5) for JDeveloper 10.1.3.0.4. It fixes some commonly-encountered critical issues. We recommend that all customers apply this Service Update. This Service Update requires that Service Update 1 has been installed. Please ensure that JDeveloper Service Update 1 is already installed before installing Service Update 5.