Refactoring in SQLFilterSheet

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Refactoring in SQLFilterSheet

Jarosław Jarmołowicz
Hi devs!

Im working on support for custom postgres types and got to place called
:SQLFilterSheet.java

It renders and manages wheres and order by generation and that's nice.
What i don't like is that we have IFs:

        if ((dataType == Types.CHAR) || (dataType == Types.CLOB)
                        || (dataType == Types.LONGVARCHAR)
                        || (dataType == Types.VARCHAR)) {
                    textColumns.put(columnName, Boolean.TRUE);
                }
and hardcoded operators for all types. (Integers don't use LIKE etc...)

I'm planning to get table definitions from CellComponentFactory and extend
IDataTypeComponent interface by:
getSupportedOperators()
getCondition(String operator, String inputValue)

Any suggestions from architectural point of view?

Regards
Jarosław Jarmołowicz
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Squirrel-sql-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-develop