Jody Garnett ha scritto:
> Andrea Aime wrote:
>> What it would be nice to have is the ability, from within
>> JDCBFeatureCollection, do so something like:
>> mySqlBuilder.getEncoder().encode(expression)
>>
> I think we may need to make a full SQL builder available ie that can
> handle:
> - SortBy
> - Expression
> - Filter
> - type name to table names
> - attribute descriptor to column name
>
> My impression is jdeolive built something like this for his H2
> DataStore, can we check if the design meets our needs?
Looked into it... basically the JDBCDataStore in the h2 module
does the primary sql encoding on its own (that takes a sizeable amount
of the 2000+ loc in that class), leaving the SQLDialect delegate to
encode column names for selects and to handle geometry query
bits such as how to grab an envelope and the like and
using a single FilterToSql to encode filters (but that one is
not using the dialect directly, so I'm wondering how
spatial filters are encoded... if they are at all... I don't see
where that is happening at least).
Soo, long story short, no, I'm not seeing anything we could reuse
on 2.4.x there. Soo, what do we do? Add the following to SQLBuilder
interface?
interface SQLBuilder {
public String encode(Expression)
public String encode(Filter)
}
and change SQLEncoder and FilteToSQL so that they do expose a
encode(Expression) and an encode(Filter, boolean wherePrefix)
methods, the latter used to get a filter encoded without
the "WHERE" prefix? Or can just do some string manipulation
in SQLBuilder implementation and get rid of it.
Now, SQLBuilder is public api, yet it's not that "public", in
a sense that the SQLBuilder class was not meant to be user
facing. Shall I roll a very quick proposal?
Cheers
Andrea
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel