示例#1
0
  public int update(DisqKindDetail entity, Integer pk) {
    // TODO Auto-generated method stub
    sql = "update disqkindDetail set disqKId=?,disqKNum=?,time=? where Id=?";

    value.add(entity.getDisqKId());
    value.add(entity.getDisqKNum());
    value.add(entity.getTime());
    value.add(entity.getId());

    genericTemplate.setSqlValue(sql);
    genericTemplate.setValues(value);
    try {
      result = genericTemplate.executeUpdate();
    } catch (Exception ex) {
      ex.printStackTrace();
    } finally {
      genericTemplate.close();
    }
    return result;
  }
示例#2
0
  public int create(DisqKindDetail entity) {
    // TODO Auto-generated method stub
    sql = "insert into disqkinddetail values (?,?,?,?)";

    value.add(entity.getId());
    value.add(entity.getDisqKId());
    value.add(entity.getDisqKNum());
    value.add(entity.getTime());

    genericTemplate.setSqlValue(sql);
    genericTemplate.setValues(value);
    try {
      result = genericTemplate.executeUpdate();
    } catch (Exception ex) {
      ex.printStackTrace();
    } finally {
      genericTemplate.close();
    }

    return result;
  }
示例#3
0
  public int delete(DisqKindDetail entity) {
    // TODO Auto-generated method stub
    sql = "delete from disqkindDetail where Id=?";
    value.add(entity.getId());
    genericTemplate.setSqlValue(sql);
    genericTemplate.setValues(value);
    try {
      result = genericTemplate.executeUpdate();
    } catch (Exception ex) {
      ex.printStackTrace();
    } finally {
      genericTemplate.close();
    }

    return result;
  }
示例#4
0
 public List<DisqKindDetail> read(DisqKindDetail entity) {
   // TODO Auto-generated method stub
   DisqKindDetailMapping disqDetailMapping = new DisqKindDetailMapping();
   DisqKindDetail disqDetail = null;
   ResultSet resultSet;
   sql = "select * from disqKindDetail where Id=?";
   value.add(entity.getId());
   genericTemplate.setSqlValue(sql);
   genericTemplate.setValues(value);
   try {
     resultSet = genericTemplate.executeQuery();
     // System.out.print(genericTemplate.executeQuery());
     disqDetail = disqDetailMapping.mapping(resultSet);
     list.add(disqDetail);
   } catch (Exception ex) {
     ex.printStackTrace();
   } finally {
     genericTemplate.close();
   }
   return list;
 }