Hello again,

I have this problem where I am pulling a feature type out of oracle and putting 
it into postgis. The primary key, "voyage_id" in the oracle table is being 
stripped from the feature type and replaced with a generic "fid" column.

The voyage_id is a foreign key and can be referenced via web applications too, 
so it needs to be there, and be the same. The fid column seems to be created 
using a new sequence, so the data in the voyage_id column is dropped altogether.

Here is a really basic version of how it's done:

SimpleFeatureType ft = ((DataStore) oracleDStore).getSchema("voyage_track");
Query q = new DefaultQuery("voyage_track");
FeatureReader fr = oracleDStore.getFeatureReader(q, Transaction.AUTO_COMMIT);
FeatureCollection fc = DataUtilities.collection(fr);

postGISDStore.createSchema(ft);
FeatureStore store = 
(FeatureStore)(postGISDStore.getFeatureSource(featureType.getTypeName()));
store.addFeatures(collection);

So hopefully I am doing it the right way... I also noticed that a similar thing 
happens when you add the Oracle table to Geoserver; the primary key column 
isn't shows in the geoserver feature type.

Is there a way I can keep it somehow?

Regards,

Miles Jordan, Systems Analyst
Australian Antarctic Data Centre | Australian Antarctic Division
Dept. for Sustainability, Environment, Water, Population and Communities
+61 3 6232 3486 | http://data.aad.gov.au


___________________________________________________________________________

    Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not 
the
intended recipient, you are notified that use or dissemination of this 
communication is
strictly prohibited by Commonwealth law. If you have received this transmission 
in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 
3209 and
DELETE the message.
        Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to