From: Chris H. <ch...@op...> - 2003-11-26 18:39:26
|
> In my special case, I must rely on the existing trigger (that uses a > sequence). The feature id is unique for all feature types, not just one > type. There are also alternative ways to access the db tables (another > application using the same data). > I assume, you don't want that the user has to set up triggers and the > like just to get a working setup. So I configuration option could be > used to specify the desired behavior (don't specify a feature id at all > and rely on triggers or specify a calculated id, however this would be > done). > It would be a pity to create an additional data store just to have a > different fid behavior. I think this could work. It'd just be an optional param in the specific DataSourceFactory (or perhaps an abstract JDBCDataStoreFactory?) . I agree, there's no reason to create an additional datastore. Could we just have different strategy objects, and the user can specify which he wants, sequence, auto incremented, ect. ? > >> How are fids calculated when a new Feature is written to the data > >> store? As far as I can tell, it is calculated within the > >> JDBCFeatureWriter.doInsert method. If so, I dont like it. Id prefer > >> to leave the fid field empty and let the database calculate it for me > >> (before insert trigger ). I agree, PostgisDataStore actually ignores the fids created by JDBCFeatureWriter.doInsert (that was actually the result of a miscommunication that we just realized, not actually planned.) I prefer it that way, and postgis now covers most cases, but when a primary key is declared and it's not a serial then things will fail, so it'd be nice to fix that case as well. Chris > >> > >> Simon > >> > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Geotools-devel mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-devel > -- |