Revision 6313 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectTable.java

View differences:

ProjectTable.java
42 42

  
43 43
import java.io.IOException;
44 44
import java.text.DateFormat;
45
import java.util.ArrayList;
45 46
import java.util.Date;
46 47

  
47 48
import javax.swing.JOptionPane;
......
54 55
import com.hardcode.gdbms.engine.instruction.SemanticException;
55 56
import com.hardcode.gdbms.parser.ParseException;
56 57
import com.iver.andami.PluginServices;
58
import com.iver.andami.messages.NotificationManager;
57 59
import com.iver.cit.gvsig.fmap.DriverException;
58 60
import com.iver.cit.gvsig.fmap.edition.EditableAdapter;
59 61
import com.iver.cit.gvsig.fmap.edition.IEditableSource;
......
459 461
			if (xml.contains("mapping")) {
460 462
				mapping = (int[]) xml.getIntArrayProperty("mapping");
461 463
				alias = (String[]) xml.getStringArrayProperty("aliases");
464
				// we check if all fields are real there (may be some external program has changed them.
465
				// If we detect any change, we discard all mapping and aliases.
466
				if (mapping.length != getModelo().getRecordset().getFieldCount()+1)
467
				{
468
					createAlias();
469
					columns.clear();
470
					for (int i = 0; i < esModel.getRecordset().getFieldCount(); i++) {
471
						addColumn(new Column());
472
					}
473
					return;
474

  
475
				}
476
				
462 477
			} else {
463 478
				try {
464 479
					createAlias();
......
477 492
			columns = Columns
478 493
					.createColumns(xml.getChild(xml.getNumChild() - 1));
479 494
		}
495
		
480 496

  
481 497
	}
482 498

  
......
739 755
//		if (columns.size() == 0) {
740 756
			columns.clear();
741 757
			try {
758
				createAlias();			
742 759
				for (int i = 0; i < sds.getFieldCount(); i++) {
743 760
					addColumn(new Column());
744 761
				}
745 762
			} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
746 763
				e.printStackTrace();
747
			}
764
				NotificationManager.addError(e);
765
			}			
748 766
//		}
749 767
	}
750 768

  

Also available in: Unified diff