You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
4 years ago
|
package com.tptj.demo.hg.dialect.creator;
|
||
|
|
||
|
import com.fr.intelli.record.Focus;
|
||
|
import com.fr.record.analyzer.EnableMetrics;
|
||
|
import com.fr.stable.UrlDriver;
|
||
|
import com.fr.stable.fun.impl.AbstractDialectCreator;
|
||
|
|
||
|
import java.sql.Connection;
|
||
|
|
||
|
/**
|
||
|
* @author 秃破天际
|
||
|
* @version 10.0
|
||
|
* Created by 秃破天际 on 2021-04-30
|
||
|
**/
|
||
|
@EnableMetrics
|
||
|
public class Demo extends AbstractDialectCreator {
|
||
|
|
||
|
@Override
|
||
|
public Class<?> generate(UrlDriver driver) {
|
||
|
if( "com.fr.third.org.hsqldb.jdbcDriver".equals( driver.getDriver() ) ){
|
||
|
return DemoHSQLDialect.class;
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
@Focus(id="com.tptj.demo.hg.dialect.creator.v10",text = "DialectCreator")
|
||
|
public Class<?> generate(Connection connection) {
|
||
|
//随意写的,实际上这里一般是根据statement来运行时区分一些小版本数据库之间的方言差异
|
||
|
if( connection.toString().contains("com.fr.third.org.hsqldb") ){
|
||
|
return DemoHSQLDialect.class;
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
}
|