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

com.sap.cds.impl.Context 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.impl;

import java.util.Map;

import com.sap.cds.DataStoreConfiguration;
import com.sap.cds.SessionContext;
import com.sap.cds.jdbc.spi.DbContext;
import com.sap.cds.jdbc.spi.SearchResolver;
import com.sap.cds.jdbc.spi.TableNameResolver;
import com.sap.cds.reflect.CdsModel;
import com.sap.cds.reflect.impl.CdsVersion;

public interface Context {

	CdsModel getCdsModel();

	DbContext getDbContext();

	SessionContext getSessionContext();

	/**
	 * Copy the values from {@code sessionContext} into current session object.
	 * 
	 * @param sessionContext the source object from which the values are copied
	 */
	void setSessionContext(SessionContext sessionContext);

	CdsVersion getCdsCompilerVersion();

	RuntimeCompatibilityMode getRuntimeMode();

	DataStoreConfiguration getDataStoreConfiguration();

	default SearchResolver getSearchResolver(Map hints) {
		return getDbContext().createSearchResolver(getCdsModel(), getSessionContext().getLocale(), hints);
	}

	default TableNameResolver getTableNameResolver() {
		return getDbContext().createTableNameResolver(getSessionContext().getLocale());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy