Cedric Hurst
Unregistered
|
|
Great article series! Wish this was around when I was first learning JPA (would have saved a lot of money on books). If I might make one suggestion, though. In listings 10 and 12, you have your productList and orderList collections specified as List. This is likely to make the following code in Listing 14 fail, for example:
for(Order allOrders: customer.getOrders())
The runtime is expecting a list of Object, not Order, so you'll need to do an explicit typecast to List<Order>. In your sample code, it looks like you are, in fact, using Generics, but you might want to update the article content to avoid confusion.
|
Athen
journeyman
Reged: 06/05/07
Posts: 79
Loc: San Francisco, CA
|
|
Thanks for calling our attention to these errors. The generics were missing in Listings 10 and 12 - fixed now, and should be fine in the code download!
-------------------- Athen O'Shea
Editor, JavaWorld.com
|
|