1 9 package org.apache.ojb.broker; 10 11 import java.util.Map ; 12 13 import org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl; 14 import org.apache.ojb.broker.metadata.ClassDescriptor; 15 16 public class RowReaderTestImpl extends RowReaderDefaultImpl 17 { 18 public RowReaderTestImpl(ClassDescriptor cld) 19 { 20 super(cld); 21 } 22 23 29 public Object readObjectFrom(Map row) 30 { 31 Object result = super.readObjectFrom(row); 32 if (result instanceof ArticleWithStockDetail) 33 { 34 ArticleWithStockDetail art = (ArticleWithStockDetail) result; 35 boolean sellout = art.isSelloutArticle; 36 int minimum = art.minimumStock; 37 int ordered = art.orderedUnits; 38 int stock = art.stock; 39 String unit = art.unit; 40 StockDetail detail = new StockDetail(sellout, minimum, ordered, stock, unit, art); 41 art.stockDetail = detail; 42 return art; 43 } 44 else 45 { 46 return result; 47 } 48 } 49 } 50 | Popular Tags |