ptyagi108 / mesh4x

Automatically exported from code.google.com/p/mesh4x
0 stars 0 forks source link

always create hibernate mapping file for MsAccess adapter #104

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The method createSyncAdapterFromFile(...) in 
org.mesh4j.sync.adapters.msaccess.MsAccessSyncAdapterFactory.java uses a 
method createMappingsIfAbsent(...). This method creates mapping files for 
data and sync table only if the files are not exists!

.....
if(!contentMappingFile.exists()){
    createMapping(mdbFileName, tableName, contentMappingFileName);
}
.....

This might be a problem if the file with same name but different mapping 
(w.r.t the table it is called) already exists and in such case there will 
be exception when adapter (hibernate based) try to access data from 
database because of that incorrct mapping file.

These mapping files should be created always irrespective of their 
previous existence.

Original issue reported on code.google.com by auni.ku@gmail.com on 6 May 2009 at 10:37

GoogleCodeExporter commented 9 years ago

Original comment by auni.ku@gmail.com on 6 May 2009 at 11:37

GoogleCodeExporter commented 9 years ago

Original comment by auni.ku@gmail.com on 6 May 2009 at 11:41

GoogleCodeExporter commented 9 years ago
Procedure for a manual test:

> Run a test that involvs a call to the factory method 
MsAccessSyncAdapterFactory.createSyncAdapterFromFile(String sourceAlias, String 
mdbFileName, String tableName) say  
org.mesh4j.sync.adapters.msaccess.MsAccessHelperTests.executeSync(). 

> Edit one of the generated hbm file such that mapping is not compatible with 
the 
correnponding table for which it was generated.

> Run the test again and the test should pass.

Original comment by auni.ku@gmail.com on 7 May 2009 at 7:30