This PR reverts #1134 and reimplements the removal of comments.
In this PR, settings related to SQL building are consolidated into SqlBuilderSettings.
public class ExampleSqlBuilderSettings implements SqlBuilderSettings {
@Override
public boolean shouldRemoveBlockComment(String comment) {
return false;
}
@Override
public boolean shouldRemoveLineComment(String comment) {
return true;
}
}
Return the instance of the above class from your Config implementation:
public class AppConfig implements Config {
...
private final SqlBuilderSettings sqlBuilderSettings = new ExampleSqlBuilderSettings();
@Override
public SqlBuilderSettings get SqlBuilderSettings() {
return sqlBuilderSettings;
}
}
Let's apply the above settings to the following SQL template:
/**
* This comment will not be removed
*/
select
*
from
EMPLOYEE -- this comment will be removed
where
EMPLOYEE_ID = /*employeeId*/0 -- this comment will be also removed
The result of the application is as follows:
/**
* This comment will not be removed
*/
select
*
from
EMPLOYEE
where
EMPLOYEE_ID = ?
This PR reverts #1134 and reimplements the removal of comments.
In this PR, settings related to SQL building are consolidated into
SqlBuilderSettings
.Return the instance of the above class from your
Config
implementation:Let's apply the above settings to the following SQL template:
The result of the application is as follows: