All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.cds.jdbc.h2.H2DbContext Maven / Gradle / Ivy

There is a newer version: 3.4.0
Show newest version
/************************************************************************
 * © 2020-2024 SAP SE or an SAP affiliate company. All rights reserved. *
 ************************************************************************/
package com.sap.cds.jdbc.h2;

import java.util.List;

import com.sap.cds.CdsDataStoreConnector.Capabilities;
import com.sap.cds.CqnTableFunction;
import com.sap.cds.DataStoreConfiguration;
import com.sap.cds.jdbc.generic.GenericDbContext;
import com.sap.cds.jdbc.spi.ExceptionAnalyzer;
import com.sap.cds.jdbc.spi.FunctionMapper;
import com.sap.cds.jdbc.spi.SessionVariableSetter;
import com.sap.cds.jdbc.spi.StatementResolver;
import com.sap.cds.jdbc.spi.TableFunctionMapper;

public final class H2DbContext extends GenericDbContext {

	public H2DbContext(DataStoreConfiguration dataStoreConfiguration) {
		super(dataStoreConfiguration);
	}

	@Override
	public FunctionMapper getFunctionMapper() {
		return new H2FunctionMapper();
	}

	@Override
	public StatementResolver getStatementResolver() {
		return new H2StatementResolver();
	}

	@Override
	public ExceptionAnalyzer getExceptionAnalyzer() {
		return new H2ExceptionAnalyzer();
	}

	@Override
	public Capabilities getCapabilities() {
		return new Capabilities() {
		};
	}

	@Override
	public SessionVariableSetter getSessionVariableSetter() {
		return new H2SessionVariableSetter();
	}

	@Override
	public TableFunctionMapper getTableFunctionMapper(Object context, @SuppressWarnings("rawtypes") List params,
			CqnTableFunction tableFunction) {
		return () -> "TABLE(ID INT=(1, 2), NAME VARCHAR=('Hello', 'World'))";
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy