Justin,

Thanks for the reply. I've actually never worked with JUnit before, but I would be wiling to give it a try (but it might take me a while, as this week is a public holiday here in China). Would it make sense to simply edit the existing test case JDBCDataStoreTest (and associated MockJDBCDataStore) to use AutoIncrementFIDMapper instead of the currently used BasicFIDMapper? Also, I'm assuming we want to test the return value of createID, though I don't think we've confirmed what the expected behavior should be yet.

Regards,
Michael

On Apr 30, 2006, at 9:20 PM, Justin Deoliveira wrote:

Hi guys,

I will have to look into this one. It sounds like Michael has spent a lot of time looking at the interaction so it is very possible it is a bug. I will have to look into it.

Michael, would it be possible to write a simple junit test case that I can use to reproduce the problem?

-Justin

Michael Brasser wrote:
I am going by uDig's usage when a new feature is drawn using the edit tool. This creates and runs a CreateAndSetNewFeature command, which in turn creates and runs an AddFeatureCommand, which includes the line:
fid=(String) resource.addFeatures(c).iterator().next();
This line eventually uses JDBCTextFeatureWriter and AutoIncrementFIDMapper from the Geotools package. The returned "fid" is later assigned to the EditGeom we are working with. One reason AutoIncrementFIDMapper looks strange to me is that its createID function seems so different from the other createID functions for the other mappers in the org.geotools.data.jdbc.fidmapper package. The main differences I see being: 1. AutoIncrementFIDMapper is the only mapper to return a null value for createID (as far as I can see). 2. AutoIncrementFIDMapper is the only mapper to return the same value every time it is used, regardless of the feature. In other words, if I were to add ten new features and were using AutoIncrementFIDMapper, the mapper would return id=null for all ten features. For all other mappers, if I were to add ten new features the mapper would return a unique id for each feature (using "SELECT MAX..", "new UID()", etc based on the specific mapper).
Regards,
Michael



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to