commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gebhardt, Jörn" <J.Gebha...@verband.creditreform.de>
Subject JXPath - Iterating over all elements that 'lie on the way'
Date Thu, 14 Jul 2005 12:00:37 GMT
Hi,

I have the following scenario:
1.) I'm using Hibernate as O/R mapping tool.
2.) I dynamically need parts of the object tree in the frontend. To achieve this, I have a
DTO structure that is similar to the Hibernate objects and that has also some kind of lazy
loading capabilities.

Now I want to use JXPath expressions to define the parts of the backend object graph that
should be shipped to the frontend.

E.g. if I have the association:
 Company (1)->(n) Department (1)->(n) Employee
(i.e. a company has several departments and each department has a number of employees)
and I have a specific company that I use as root context and I want to retrieve all employoees
of the company I'd write some code like this:

JXPathContext.newContext(company).iterate("departments/employees")

However, I also want to iterate over all objects that 'lie on the way', i.e. in the above
example I additionally want to iterate over all departments.

Is there a way to access all objects that have been visited while resolving the XPath expression?
Or can I write my own extension to the reference implementation that helps me, collecting
all these objects?

Thanks in advance,
Jörn


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message