Yes, Tucson, AZ... How did you know?
Thanks for the reply.
I got some very interesting and unexpected results.
The exact query is
Code:
String shipname = "Extra photos";
List result = session.find( "from User as u inner join u.shipments as s where s.name = :shipName ", shipname, Hibernate.STRING);
The result of this is a List of
arrays, each of which contains two Objects, a Parent (i.e., User) and a Child (i.e., Shipment).
For example, the following code calls the toString() method on each object:
Code:
iter = result.iterator();
while( iter.hasNext())
{
Object[] oa = (Object[])iter.next();
System.out.println( oa.length);
for (int i = 0; i < oa.length; i++)
{
System.out.println(oa[i]);
}
}
With the following output:
Code:
2
<User>Id: [40288134fc05daa300fc05daab0c0001], Name: [Randy Kahle], Email: [randy@foo.org], Shipments: [[<Shipment>Id: [40288134fc05daa300fc05daab480009], Name: [Trip Photos], Priority: [null]</Shipment>, <Shipment>Id: [40288134fc05daa300fc05daab4a000a], Name: [Extra photos], Priority: [null]</Shipment>]]</User>
<Shipment>Id: [40288134fc05daa300fc05daab4a000a], Name: [Extra photos], Priority: [null]</Shipment>
Questions:
* Is a
List of
arrays the expected result?
* How might the query be changed to return just the Parent (i.e. User) object?