/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved.
 * <a>http://www.crunii.com</a>
 */
package com.crunii.micro.ds.single.jpa;

import org.hibernate.dialect.*;
import org.springframework.orm.jpa.vendor.Database;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;

/**
 * @author shenhs create 2023/5/22 16:56
 */
public class DmHibernateJpaVendorAdapter extends HibernateJpaVendorAdapter {

	public DmHibernateJpaVendorAdapter(){
		super();
	}

	protected Class<?> determineDatabaseDialectClass(Database database) {
		switch(database) {
		case DB2:
			return DB2Dialect.class;
		case DERBY:
			return DerbyTenSevenDialect.class;
		case H2:
			return H2Dialect.class;
		case HANA:
			return HANAColumnStoreDialect.class;
		case HSQL:
			return HSQLDialect.class;
		case INFORMIX:
			return Informix10Dialect.class;
		case MYSQL:
			return MySQL57Dialect.class;
		case ORACLE:
			return Oracle12cDialect.class;
		case POSTGRESQL:
			return PostgreSQL95Dialect.class;
		case SQL_SERVER:
			return SQLServer2012Dialect.class;
		case SYBASE:
			return SybaseDialect.class;
		default:
			return DmDialect.class;
		}
	}

}
