On Fri, 27 Feb 2009, Andi Vajda wrote:
If you add --package java.lang to your jcc invocation, the getRelationShips()
methods do get wrapped.
As suspected, the pre-1.5 building blocks theory seems to be at work here.
For example, the getRelationShips(RelationShipType... types) method gets
wrapped as taking a RelationShipType array.
java::lang::Iterable Node::getRelationships(const
JArray<org::neo4j::api::core::RelationshipType>& a0) const
{
return java::lang::Iterable(env->callObjectMethod(this$,
mids$[mid_getRelationships_5b47f265], a0.this$));
}
In other words, JCC wraps these methods fine but loses the generic
information. In Python, the invocation is going to be returning an Iterable
of Object, not RelationShip as expected if JCC was heeding the generic
annotations.
By the way, the Iterator returned from Iterable's iterator method has the
same issue but it should still appear as a Python iterator nonetheless; you
can pass it to list() or use it in a straightforward for loop, etc...
for relationship in node.getRelationShips([types, ...]).iterator():
...
Andi..