We have HibernateMetadataBuilderContributor Like below. Which works in Hibernate 5 or Spring boot 2.7. But not working when we migrate to Hibernate 6 or Spring boot 3.
public class HibernateMetadataBuilderContributor implements MetadataBuilderContributor {
public static final String STRING_AGG = "string_agg";
public static final String STRING_AGG_ORDER_BY = "string_agg_order_by";
public static final String STRING_AGG_DISTINCT = "string_agg_distinct";
@Override
public void contribute(final MetadataBuilder metadataBuilder) {
metadataBuilder.applySqlFunction(STRING_AGG, new SQLFunctionTemplate(StandardBasicTypes.STRING, "string_agg(?1, ?2)"));
metadataBuilder.applySqlFunction(STRING_AGG_ORDER_BY, new SQLFunctionTemplate(StandardBasicTypes.STRING, "string_agg(?1, ?2 order by ?3)"));
metadataBuilder.applySqlFunction(STRING_AGG_DISTINCT, new SQLFunctionTemplate(StandardBasicTypes.STRING, "string_agg(distinct ?1, ?2)"));
}
}
SQLFunctionTemplate is not found in Hibernate 6, what is the alternative.