Allow primary key columns to be part of the feature type
--------------------------------------------------------

                 Key: GEOT-2296
                 URL: http://jira.codehaus.org/browse/GEOT-2296
             Project: GeoTools
          Issue Type: Improvement
          Components: data jdbc-ng
            Reporter: Andrea Aime
            Assignee: Justin Deoliveira


One of the new features we're discussing with Tike is the ability to map the 
primary key columns inside the feature type instead of hiding them and mapping 
them into the fid only.

The old jdbc data stores has a flag in the fid mappers to decide if to eat away 
the primary key columns or not. 
That was actually used only by multicolumn primary keys, but the user had the 
right to manually impose a fid mapper, and thus
coerce the database to return pk column as part of the schema no matter what.

Now, assuming we do this on a per feature type, how do we do this in the NG 
datastores?
The PrimaryKey class seems like a good place to keep the pk column mapping flag.
What about API wise? The flag influences how a schema is built, but I see 
JDCBDataStore delegates the schema construction
to the feature source.

So, do we add a JDBCFeatureSource.isPKMappingEnabled() and a 
setPKMappingEnabled()?

Implementation wise, this will influence all reading and writing code.
There is also a write wise issue. If the PK is mapped inside the feature type, 
what do you use to build the actual PK columns?
The fid or the attribute values?
For database generated values such as sequences and the like, the answer is 
neither, the database does it.
For those that are to be specified by the user, I'd say to go with the 
attribute values, as the way the fid
is build might not be obvious (see also the issue about the way multicolumn pk 
values are mapped into a fid).

Opinions?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to