Yep, I am 

First, I meant DB2 does not allow an underscore as the first character of a 
table name.  Sorry.
Second, I talked only about meta information. 


About Sequences: 

The method 

public String getSequenceForColumn(String schemaName, String tableName, 
String columnName, Connection cx) throws SQLException { 

in the DB2 Dialect checks only if there exists a sequence with the name
tableName + "_" + columnName + "_SEQUENCE" 

That is poor. What if I want to have unique ids in the whole db, not only 
within a table. No chance at the moment. Perhaps I should
drop the sequence support completely and remove GEOT-2015. The lookup plugin 
gives a possibility to use another sequence name or throw a 
NotSupportedException. 

 

About Auto Generated Keys 

I cannont support autoincrement columns, no chance to get the value before 
or after the insert. The Jdbc API Statement.getGeneratedKeys() would be the 
right way. The real problem is the method 

   public boolean lookupGeneratedValuesPostInsert() 

For DB2, this is not true and not false. Again, the lookup plugin gives me 
the possibility of a NotSupportedException. 

Your opinion ? 

 


Andrea Aime writes: 

> Christian Müller ha scritto:
>> A big +1 for interface or base class,I think a base class would be fine. 
>> 
>> @Justin, asfaik , DB2 does not allow underlines in table names. I am not 
>> a friend of such default assumptions.
> 
> DB2 does not allow for underscore? Odd? 
> 
>> @Andrea, look at http://jira.codehaus.org/browse/GEOT-2015, it would be a 
>> good idea to have an additional method
>> String getSequenceNameForPrimaryKey(String schema, String table, 
>> Connection cx);
> 
> Hum, we already have:
> public String getSequenceForColumn(String schemaName, String tableName, 
> String columnName, Connection cx) throws SQLException { 
> 
> and: 
> 
> public Object getNextSequenceValue(String schemaName, String sequenceName, 
> Connection cx )
>         throws SQLException { 
> 
> So sequences should be well covered? 
> 
>> I really would like to have the possibility of a db specific 
>> implementation. Users with special requirements should be able to add 
>> their own.
>> Until now, I have not checked how DB2 behaves in case of updatable views. 
>> Another reason for a big +1 for a class/interface.
> 
> Mind, the thing I'm proposing will just generate PrimaryKey objects.
> Those are just information, they contain PrimaryKeyColumn that will
> tell you if the column has a sequence, is autoincrement, or user set.
> That is it. Pure metadata. The actual code that grabs the pk values
> is spread around the JDBCDataStore class. 
> 
> I actually have the mandate to just make it possible to lookup
> Oracle sequence names by using a lookup table, but the sponsor has
> been generous enough to allow some more work so that this lookup
> table could be used by other databases as well. 
> 
> Actual code that generate the pk values won't be included in the lot
> anyways. If I can't make this more general version I'll just fall back
> on making a Oracle specific modification in the Oracle dialect. 
> 
> Are you still interested in having the primary key lookup system
> based on an abstract class? :-) 
> 
> Cheers
> Andrea 
> 
> -- 
> Andrea Aime
> OpenGeo - http://opengeo.org
> Enterprise support for open source geospatial. 
> 
 


------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to