JAVAEE-继承
1.通过继承扩展POJO
子类扩展父类时,可以使用该方式
注入父类属性并进行扩展(注意父类需要有无参构造)
当多模块时,特殊的pojo有可能出现模块间循环依赖问题,那么根据业务情况可以使用如下方法,配在对应位置(非Common)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
   | import com.e3mall.pojo.TbItem;
 
 
 
 
 
  public class Item extends TbItem {
   
 
 
      public Item(TbItem item) {         this.setId( item.getId());         this.setTitle(item.getTitle());         this.setSellPoint(item.getSellPoint());         this.setPrice( item.getPrice());         this.setNum(item.getNum()) ;         this.setBarcode(item.getBarcode());         this.setImage( item.getImage());         this.setCid( item.getCid());         this.setStatus(item.getStatus()) ;         this.setCreated( item.getCreated());         this.setUpdated( item.getUpdated()) ;     }
      
 
 
      public String[] getImages() {         String image = this.getImage();         if (image!=null&&!"".equals(image)){             String[] split = image.split(",");             return split;         }         return null;     } }
   |