Package net.datacrow.core.modules

Examples of net.datacrow.core.modules.MappingModule


       
        return success;
    }
   
    private boolean cleanupReferences() {
      MappingModule mm;
      DcModule pm;
      DcModule cm;
      String sql;
      ResultSet rs;
      int count;
      for (DcModule module : DcModules.getAllModules()) {
       
        if (module.getType() == DcModule._TYPE_MAPPING_MODULE) {
          try {
            mm = (MappingModule) module;
            pm = DcModules.get(mm.getParentModIdx());
            cm = DcModules.get(mm.getReferencedModIdx());
           
            sql = "select count(*) as INVALIDENTRIES from " + mm.getTableName() + " where objectid not in " +
            "(select id from " + pm.getTableName() + ") or referencedid not in " +
            "(select id from " + cm.getTableName() + ")";
           
            rs = DatabaseManager.executeSQL(sql);
            rs.next();
            count = rs.getInt(1);
            rs.close();
           
            if (count > 0) {
              logger.info("Cleaning " + mm.getTableName() + " of " + count + " ghost record(s).");
             
              sql = "delete from " + mm.getTableName() + " where objectid not in " +
                "(select id from " + pm.getTableName() + ") or referencedid not in " +
                "(select id from " + cm.getTableName() + ")";
           
              rs = DatabaseManager.executeSQL(sql);
             
View Full Code Here


        itemForm.setListener(this);
        itemForm.setVisible(true);
    }
       
    private void openDialog() {
        MappingModule mappingModule = (MappingModule) DcModules.get(mappingModIdx);
        DcReferencesDialog dlg = new DcReferencesDialog(references, mappingModule);
       
        dlg.setVisible(true);
       
        if (dlg.isSaved()) {
View Full Code Here

TOP

Related Classes of net.datacrow.core.modules.MappingModule

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.