Hey, if anyone's hacking on this code, could you put in a bit of a
better error report?
Now that many people are using postgres 8, when they forget their
primary key they get a message about oid's not found. Perhaps have that
error report say 'no oid's found - if you are using postgres 8 or later
you need to define a primary key on your data'.
The more elegant way would be to check the version before trying to use
the oidfidmapper, and if there's no primary key and it's later than when
oid's were phased out raise the right message about no primary key. But
the former's probably easier, and would work fine.
Chris
Jesse Eichar wrote:
Hi Michael,
I was preparing for a demo so it is possible that the classes are
redundant and I didn't have time to correctly investigate the issue.
I'm looking into it now and this is my current understanding, anyone
can correct me I'm still learning postgis.
OIDFidMapper and PostGISAutoIncrementMapper are not redundant because:
1. OIDFidMapper is used when there is no Primary key and as a last
resort. PostGISAutoIncrementMapper is used when there is a primary key.
2. The implementation of createID in PostGISAutoIncrementMapper only
works on postgres 8+ databases. If the db is not a postgres 8+ then it
uses the AutoIncrementFIDMapper to obtain the featureID.
MaxIncFIDMapper and AutoIncrementFIDMapper are not redundant because
MaxIncFIDMapper is used when the primary key is NOT autoincrement. The
implementations are the same because I don't know a way in SQL to query
for the last returned item in the sequence and so ended up using the
same query. If there is no way to make that query then perhaps
AutoIncrementFIDMapper should be abstract and all datastore should have
their own subclass of AutoIncrementFIDMapper.
Comments are welcome.
Jesse
On 26-May-06, at 1:09 AM, Michael Brasser wrote:
Jesse,
THANK YOU for your updates to the PostGIS feature id mapper (and
AutoIncrementFIDMapper). This one has been bugging us for a while
(GEOT-847, which I have now closed).
It seems like the updates have made a couple classes redundant
(correct me if I'm wrong):
+OIDFidMapper.java or PostGISAutoIncrementFIDMapper.java
One uses PGStatement, and the other use SQL, but I think they do the
same thing...
+MaxIncFIDMapper.java or AutoIncrementFIDMapper.java
One uses "Select MAX...", and the other uses "...order by...", but
again I think they do the same thing...
Michael
Jesse Eichar (JIRA) wrote:
postgis doesn't raise events
----------------------------
Key: UDIG-809
URL: http://jira.codehaus.org/browse/UDIG-809
Project: uDIG
Type: Bug
Components: postgis
Versions: UDIG 1.1.RC0
Reporter: Jesse Eichar
Assigned to: Jody Garnett
Fix For: uDig Alberta Demo
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
--
Chris Holmes
The Open Planning Project
http://topp.openplans.org
begin:vcard
fn:Chris Holmes
n:Holmes;Chris
org:The Open Planning Project
adr:;;377 Broadway, 11th Floor;New York;NY;10013;USA
email;internet:[EMAIL PROTECTED]
title:VP, Strategic Development
x-mozilla-html:FALSE
url:http://topp.openplans.org
version:2.1
end:vcard