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

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:
getCondition(String operator, String inputValue)

Any suggestions from architectural point of view?

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.
Squirrel-sql-develop mailing list
[hidden email]