We would like to control the naming of contraints when JpaBuddy generates Liquibase from Jpa Entities. When I add the names explicitly e.g. via @ForeignKey JpaBuddy makes them upper case what I don't want. The better approach to implement an Implicit Naming Strategy class for Hibernate JpaBuddy seems not to support those. Is this right or are there any tricks to do so. Here is a sample of this class:
public class HibernateConstraintsNamingStrategy extends ImplicitNamingStrategyJpaCompliantImpl {
@Override
public Identifier determineForeignKeyName(ImplicitForeignKeyNameSource source) {
return Identifier.toIdentifier(
"fk_" + source.getTableName() + "$" + source.getColumnNames().get(0).getText() + "$pk_"
+ source.getReferencedTableName().getText());
}
@Override
public Identifier determineUniqueKeyName(ImplicitUniqueKeyNameSource source) {
return Identifier.toIdentifier(
"uk_" + source.getTableName() + "$" + source.getColumnNames().stream()
.map(Identifier::getText).collect(Collectors.joining("$")));
}
JpaBuddy leaves the case of the name of the @ForeignKey annotations JpaBuddy supports implicit naming strategy of hibernate