Question: I have an array which is the result of a select query using Amazon SimpleDb. 

Here is sample data when I print\_r($result);

```
Array ( [0] => Array ( [Name] => 5140ede647e74
                       [Attributes] => Array (
                            [0] => Array ( [Name] => test_id [Value] => 5140ede647e74 )
                            [1] => Array ( [Name] => test_name [Value] => test1 )
                            [2] => Array ( [Name] => last_update [Value] => 1363209702 )
                            [3] => Array ( [Name] => created [Value] => 1363209702 ) ) ) ) 

```

If I want to extract the test\_id and the test\_name, how can I do it? I am currently doing the following

```
<?php foreach ($result as $item) {
    echo $item['Attributes'][0]['Value']; 
    echo $item['Attributes'][1]['Value'];
} ?>

```

But I want to do it by referencing "test\_id" and "test\_name" because when I delete the domain where the data resides and re-enter the data, the order of each attribute can change so I can't trust that $item['Attributes'][0]['Value'] will always be the test\_id

Thanks!

Answer: 
No you can't, you need to create an intermediate class that contains the List. Your map will become :

```
Map<PartType, Parts> inventory;

```

And you need to create a new class with its own mapping :

```
public class Parts {

   private List<Part> parts;

}

```
IMO it should be an `Id` of `PartType` pojo

```
<map name="mymap" cascade="all">
         <key column="parttype_id"/>
            .
            .
            .

      </map>

```