use of com.blazebit.persistence.view.impl.macro.FunctionPassthroughJpqlMacro in project blaze-persistence by Blazebit.
the class MetamodelBuildingContextImpl method createTypeValidationExpressionFactory.
private MacroConfigurationExpressionFactory createTypeValidationExpressionFactory() {
MacroConfiguration originalMacroConfiguration = expressionFactory.getDefaultMacroConfiguration();
ExpressionFactory cachingExpressionFactory = expressionFactory.unwrap(AbstractCachingExpressionFactory.class);
Map<String, MacroFunction> macros = new HashMap<>();
macros.put("view", new JpqlMacroAdapter(new FunctionPassthroughJpqlMacro("VIEW"), cachingExpressionFactory));
macros.put("view_root", new JpqlMacroAdapter(new FunctionPassthroughJpqlMacro("VIEW_ROOT"), cachingExpressionFactory));
macros.put("embedding_view", new JpqlMacroAdapter(new FunctionPassthroughJpqlMacro("EMBEDDING_VIEW"), cachingExpressionFactory));
MacroConfiguration macroConfiguration = originalMacroConfiguration.with(macros);
return new MacroConfigurationExpressionFactory(cachingExpressionFactory, macroConfiguration);
}
Aggregations