Cayenne 4.2—Modifying SQL generation to alway s use COALESCE when updating a certain column

Hugi Thordarson <[email protected]>
Newsgroups gmane.comp.java.cayenne.user
Message-ID <[email protected]>
Working with old DB designs really results in the weirdest questions…

So… I've been working around a design problem in a customer DB by using my own BatchTranslatorFactory. The functionality was that if a column is called "company", every update wraps the column's new value in a coalesce function to ensure that it's never set to null (for… reasons). This has worked great as a workaround for our problem.

However, SQL generation in Cayenne 4.2 is all new so my current solution ( https://gist.github.com/hugith/a33a20fc7da7fd8f709f59ce3a30a96a <https://gist.github.com/hugith/a33a20fc7da7fd8f709f59ce3a30a96a> ) doesn't really port.
Before I start considering migration to 4.2, is this possible to do there? Or should I just bite the bullet and start fixing up that bloody DB before upgrading?

Cheers,
- hugi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.