Package org.jeecgframework.core.common.model.common

Examples of org.jeecgframework.core.common.model.common.DBTable


          e.printStackTrace();
        }
      }
      String ids = request.getParameter("ids");
      XStream xStream = new XStream();
      DBTable dbTable = new DBTable();
      dbTable.setTableName("jeecg_demo");
      dbTable.setClass1(JeecgDemo.class);
      String sql = "select * from jeecg_demo";
      if(StringUtil.isNotEmpty(ids) && ids.split(",").length>0){
        sql += " where id in ('"+ids.replaceAll(",", "','")+"')";
      }
      List<JeecgDemo> list = jdbcDao.find(sql, JeecgDemo.class, null);
      //jdbcDao.executeSql("delete from jeecg_demo", null);
      dbTable.setTableData(list);
      xStream.processAnnotations(DBTable.class);
      FileOutputStream outputStream = new FileOutputStream(savePath);
      Writer writer = new OutputStreamWriter(outputStream, "UTF-8");
      writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n");
      xStream.toXML(dbTable, writer);
View Full Code Here


        if(sqlDirFile.isDirectory()){
          sqlfilename += sqlDirFile.list()[0];
        }
        XStream xStream = new XStream();
        xStream.processAnnotations(DBTable.class);
        DBTable dbTable = (DBTable) xStream.fromXML(new File(sqlfilename));
        if(dbTable.getClass1() != null ){
          //List list = dbTable.getTableData();
          commonService.batchSave(dbTable.getTableData());
          /*org.jeecgframework.core.util.LogUtil.info(list.size());
          for (Object object : list) {
            commonService.save(object);
          }*/
        }
 
View Full Code Here

  public List<DBTable> getAllDbTableName() {
    List<DBTable> resultList = new ArrayList<DBTable>();
    SessionFactory factory = getSession().getSessionFactory();
    Map<String, ClassMetadata> metaMap = factory.getAllClassMetadata();
    for (String key : (Set<String>) metaMap.keySet()) {
      DBTable dbTable = new DBTable();
      AbstractEntityPersister classMetadata = (AbstractEntityPersister) metaMap
          .get(key);
      dbTable.setTableName(classMetadata.getTableName());
      dbTable.setEntityName(classMetadata.getEntityName());
      Class<?> c;
      try {
        c = Class.forName(key);
        JeecgEntityTitle t = c.getAnnotation(JeecgEntityTitle.class);
        dbTable.setTableTitle(t != null ? t.name() : "");
      } catch (ClassNotFoundException e) {
        e.printStackTrace();
      }
      resultList.add(dbTable);
    }
View Full Code Here

TOP

Related Classes of org.jeecgframework.core.common.model.common.DBTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.