zoukankan      html  css  js  c++  java
  • 在数据库中outlet、code、outline为联合组件。hibarnate插入可如此插入

    hibarnate对象的映射文件如下

    <id name="outlet" type="string">
    <column name="OUTLET" length="10" />
    <generator class="assigned" />
    </id>
    <!-- <property name="code" type="string">
    <column name="CODE" length="10" />
    </property> -->
    <property name="code" type="string">
    <column name="CODE" length="5" />
    </property>
    <property name="outline" type="string">
    <column name="OUTLINE" length="5" />
    </property>

    在数据库中outlet、code、outline为联合组件。hibarnate插入可如此插入

    if(null!=outlet){
    String[] outlets1 = outlet.split(",");
    String cade=discHd.getCode();
    for(int i=0;i<outlets1.length;i++){
    System.out.println(i+":"+outlets1[i]);
    DiscS discS=new DiscS();
    discS.setOutlet(outlets1[i]);
    discS.setCode(cade);//不变
    discS.setOutline("6");
    discS.setUpdatedBy("0000001");
    discSService.save(discS);
    }
    }

    因为映射文件中的id定义为outlet,而插入时是不相同的。所以可以插入!

  • 相关阅读:
    12306.cn网站自动登录器源代码
    从IL看C#
    CanvasRenderingContext2Dhtml5的关键
    慎用Response.Write()
    JPanel 的getGraphics
    怎么用swing绘图
    Win7 双硬盘启动出错处理
    paint repaint实现动画
    多线程一例
    画图,橡皮
  • 原文地址:https://www.cnblogs.com/OP-RONG/p/4240903.html
Copyright © 2011-2022 走看看