How to properly render SQL in a custom SqlGenerator?

Hi everyone,

I have a use-case in wich I would like to influence rendering of identifiers like table and column names. Sometimes I would like to have them lower- and sometimes upper-case, depending on some custom rules. I’ve found the SqlGenerator-approach using Java Service Loader and implemented one generator, but ran into trouble understanding where I get the default SQL rendering from. Depending on what I use I either don’t get anythign or StackoverflowErrors and stuff.

The docs only say to call “super”, but that doesn’t work, because the generator seems to be one part of a chain instead. OTOH, if I call the chain, I sometimes get back empty arrays without any SQL, which doesn’t seem to help too much. Some of the given statements implement a useful “toString” returning SQL, others don’t.

public Sql[] generateSql(AbstractSqlStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
	Sql[] chainSql = sqlGeneratorChain.generateSql(statement, database);

I don’t get the point: How to I call the base/default/… implementation to always return the SQL like it would be generated without my generator?