com.sap.cds.jdbc.hana.HanaFunctionMapper Maven / Gradle / Ivy
The newest version!
/*******************************************************************
* © 2023 SAP SE or an SAP affiliate company. All rights reserved. *
*******************************************************************/
package com.sap.cds.jdbc.hana;
import java.util.List;
import java.util.Locale;
import com.sap.cds.jdbc.generic.GenericFunctionMapper;
public class HanaFunctionMapper extends GenericFunctionMapper {
@Override
public String toSql(String cqnFunc, List args) {
String function = cqnFunc.toLowerCase(Locale.US);
return switch (function) {
case "matchespattern" -> args.get(0) + " LIKE_REGEXPR " + args.get(1) + " FLAG " + args.get(2);
default -> super.toSql(cqnFunc, args);
};
}
}