Breaking change in Records (Most changes in SqlRecords) versions 378+

3 views
Skip to first unread message

Daniel Worthington-Bodart

unread,
Aug 1, 2011, 5:19:13 AM8/1/11
to total...@googlegroups.com
Hi people,

I've finally got around to cleaning up SqlRecords, most of the changes are internal to it's implementation but some of the changes have been about unifying how Lucene and SQL records are exposed. And so I have made a few breaking changes, If you are not using Records for data access then there is no change in the rest of the TL.

Summary moves and renames (use in search and replace):
com.googlecode.totallylazy.records.Keyword.keyword ---> com.googlecode.totallylazy.records.Keywords.keyword OR com.googlecode.totallylazy.records.sql.SqlKeywords.keyword
com.googlecode.totallylazy.records.ParameterisedExpression ---> com.googlecode.totallylazy.records.sql.expressions.Expression


Details
  • Keyword is now an interface
    • Replace static method 'Keyword.keyword' with 'Keywords.keyword' (Notice the 's')
    • Moved SQL specific implicit aliasing out of Keyword and into SqlKeywords static methods.
      • If your keyword contains a '.' and is for SQL dataaccess then use SqlKeyword.keyword(...)
  • Keywords and Aggregates are now aliased in the same way -> call 'keywordInstance.as(...)' or 'aggregateInstance.as(...)'
  • 'Queryable' interface is now generic and both SqlRecords and LuceneRecords implement it but each take an implementation specific query object (Sql takes an 'Expression' and Lucene takes an 'org.apache.lucene.search.Query' object)
  • 'ParameterisedExpression' has moved and been renamed to 'sql.expressions.Expression'.
    • How Sql is generated internally has had a massive refactor
      • I've removed the once massive Sql class and broken down all the different types of clauses, statements into individual expression objects
      • Debugging Sql expressions is really rather beautiful now as you can see the exactly how the expression was built up, rather than it just being a String.
      • ToString on an Expression will now insert the values back into the SQL so you should see the actual SQL in the logs etc.

Please reply if I missed anything or you have any issues.

Thanks

Dan

daniel...@gmail.com

unread,
Aug 1, 2011, 5:58:11 AM8/1/11
to totallylazy
Stu and Ali pointed out that if you are using newing up
ParameterisedExpression you will need to use the factory methods on
Expressions as Expression is an interface.

On Aug 1, 10:19 am, Daniel Worthington-Bodart <d...@bodar.com> wrote:
> Hi people,
>
> I've finally got around to cleaning up SqlRecords, most of the changes are
> internal to it's implementation but some of the changes have been about
> unifying how Lucene and SQL records are exposed. And so I have made a few
> breaking changes, If you are not using Records for data access then there is
> no change in the rest of the TL.
>
> *Summary moves and renames (use in search and replace):*
> com.googlecode.totallylazy.records.Keyword.keyword *--->* com.googlecode.
> totallylazy.records.Keywords.keyword *OR* com.googlecode.totallylazy.records
> .sql.SqlKeywords.keyword
> com.googlecode.totallylazy.records.ParameterisedExpression *---> *com.
> googlecode.totallylazy.records.sql.expressions.Expression
>
> *Details*
>
>    - Keyword is now an interface
>       - Replace static method 'Keyword.keyword' with 'Keywords.keyword' (Notice
>       the 's')
>       - Moved SQL specific implicit aliasing out of Keyword and into
>       SqlKeywords static methods.
>          - If your keyword contains a '.' and is for SQL dataaccess then use
>          SqlKeyword.keyword(...)
>       - Keywords and Aggregates are now aliased in the same way -> call '
>    keywordInstance.as(...)' or 'aggregateInstance.as(...)'
>    - 'Queryable' interface is now generic and both SqlRecords and
>    LuceneRecords implement it but each take an implementation specific query
>    object (Sql takes an 'Expression' and Lucene takes an 'org.apache.lucene.
>    search.Query' object)
>    - 'ParameterisedExpression' has moved and been renamed to 'sql.
>    expressions.Expression'.
>       - How Sql is generated internally has had a massive refactor
>          - I've removed the once massive Sql class and broken down all the
>          different types of clauses, statements into individual expression
>          objects<http://code.google.com/p/totallylazy/source/browse/#hg%2Fsrc%2Fcom%2F...>
>          - Debugging Sql expressions is really rather beautiful now as you
>          can see the exactly how the expression was built up, rather
> than it just
>          being a String.
>          - ToString on an Expression will now insert the values back into
Reply all
Reply to author
Forward
0 new messages