本文整理了Java中com.sqlapp.data.db.dialect.Dialect.getSqlFactoryRegistry()
方法的一些代码示例,展示了Dialect.getSqlFactoryRegistry()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dialect.getSqlFactoryRegistry()
方法的具体详情如下:
包路径:com.sqlapp.data.db.dialect.Dialect
类名称:Dialect
方法名:getSqlFactoryRegistry
暂无
代码示例来源:origin: com.sqlapp/sqlapp-core
protected SqlFactoryRegistry createSqlFactoryRegistry(){
return dialect.getSqlFactoryRegistry();
}
}
代码示例来源:origin: com.sqlapp/sqlapp-command
private SqlFactoryRegistry getSqlFactoryRegistry(DbCommonObject<?> target){
SqlFactoryRegistry sqlFactoryRegistry=getSqlFactoryRegistry();
if (sqlFactoryRegistry==null){
Dialect dialect=SchemaUtils.getDialect(target);
return dialect.getSqlFactoryRegistry();
}
return sqlFactoryRegistry;
}
代码示例来源:origin: com.sqlapp/sqlapp-command
/**
* @return the sqlFactoryRegistry
*/
public SqlFactoryRegistry getSqlFactoryRegistry() {
if (sqlFactoryRegistry != null) {
return sqlFactoryRegistry;
}
if (this.getDialect() != null) {
this.sqlFactoryRegistry = this.getDialect().getSqlFactoryRegistry();
}
return sqlFactoryRegistry;
}
代码示例来源:origin: com.sqlapp/sqlapp-command
private SqlFactoryRegistry getSqlFactoryRegistry(DbCommonObject<?> target){
SqlFactoryRegistry sqlFactoryRegistry=getSqlFactoryRegistry();
if (sqlFactoryRegistry==null){
Dialect dialect=SchemaUtils.getDialect(target);
return dialect.getSqlFactoryRegistry();
}
return sqlFactoryRegistry;
}
代码示例来源:origin: com.sqlapp/sqlapp-command
private boolean operateTable(Connection connection, Dialect dialect, Table table, SqlType sqlType) throws SQLException{
SqlFactory<Table> operationFacroty=dialect.getSqlFactoryRegistry().getSqlFactory(table, sqlType);
List<SqlOperation> operations=operationFacroty.createSql(table);
if (operations.isEmpty()){
return false;
}
ConnectionSqlExecutor exec=new ConnectionSqlExecutor(connection);
exec.setAutoClose(false);
exec.execute(operations);
return true;
}
代码示例来源:origin: com.sqlapp/sqlapp-command
public boolean exists(Dialect dialect, Connection connection, Table table, Long id) throws SQLException{
List<SqlOperation> sqlOperations=dialect.getSqlFactoryRegistry().createSql(table, SqlType.SELECT_BY_PK);
SqlOperation sqlOperation=sqlOperations.get(0);
String sql=sqlOperation.getSqlText();
int transactionIsolation=connection.getTransactionIsolation();
try{
connection.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
ParametersContext context=new ParametersContext();
try(Statement statement=connection.createStatement();){
SqlConverter sqlConverter=new SqlConverter();
SqlNode sqlNode=sqlConverter.parseSql(context, sql);
context.put(this.getIdColumnName(), id);
boolean[] exists=new boolean[]{false};
JdbcHandler jdbcHandler=new JdbcHandler(sqlNode){
@Override
protected void handleResultSet(ExResultSet resultSet) throws SQLException {
exists[0]=resultSet.next();
}
};
jdbcHandler.execute(connection, context);
return exists[0];
}
} finally{
connection.setTransactionIsolation(transactionIsolation);
}
}
代码示例来源:origin: com.sqlapp/sqlapp-command
protected void applyFromFileByTable(Connection connection, Dialect dialect, Table table, List<File> files) throws EncryptedDocumentException, InvalidFormatException, IOException, XMLStreamException, SQLException{
SqlFactoryRegistry sqlFactoryRegistry=dialect.getSqlFactoryRegistry();
SqlFactory<Table> factory=sqlFactoryRegistry.getSqlFactory(table, this.getSqlType());
List<SqlOperation> operations=factory.createSql(table);
代码示例来源:origin: com.sqlapp/sqlapp-command
DbObjectDifference diff=currentTable.diff(table, equalsHandler);
ConnectionSqlExecutor executor=new ConnectionSqlExecutor(connection);
List<SqlOperation> sqlList=dialect.getSqlFactoryRegistry().createSql(diff);
executor.setAutoClose(false);
if (!sqlList.isEmpty()){
List<SqlOperation> lockTableSqlList=dialect.getSqlFactoryRegistry().createSql(table, SqlType.LOCK);
executor.execute(lockTableSqlList);
executor.execute(sqlList);
代码示例来源:origin: com.sqlapp/sqlapp-command
List<SqlOperation> ddlAutoCommitOffSqlList=dialect.getSqlFactoryRegistry().createSql(SqlType.DDL_AUTOCOMMIT_OFF);
List<SqlOperation> lockTableSqlList=dialect.getSqlFactoryRegistry().createSql(table, SqlType.LOCK);
ConnectionSqlExecutor executor=new ConnectionSqlExecutor(this.getConnection());
executor.setAutoClose(false);
代码示例来源:origin: com.sqlapp/sqlapp-command
protected void applyFromFileByRow(Connection connection, Dialect dialect, Table table, List<File> files) throws EncryptedDocumentException, InvalidFormatException, IOException, XMLStreamException, SQLException{
SqlFactoryRegistry sqlFactoryRegistry=dialect.getSqlFactoryRegistry();
sqlFactoryRegistry.getOption().setTableOptions(this.getTableOptions());
SqlFactory<Row> factory=sqlFactoryRegistry.getSqlFactory(new Row(), this.getSqlType());
代码示例来源:origin: com.sqlapp/sqlapp-core
/**
* 検索用のSQLを生成します
*
* @param table
* @throws SQLException
*/
protected String createSql(Table table) throws SQLException {
dialect = DialectResolver.getInstance().getDialect(connection);
SqlFactory<Table> sqlFactory = dialect
.getSqlFactoryRegistry().getSqlFactory(table,
SqlType.SELECT_ALL);
Options options;
if (this.options!=null){
options=this.options.clone();
} else{
options = sqlFactory.getOptions()
.clone();
}
options.setDecorateSchemaName(true);
sqlFactory.setOptions(options);
List<SqlOperation> operationTexts = sqlFactory.createSql(table);
SqlOperation operationText = CommonUtils.first(operationTexts);
return operationText.getSqlText();
}
代码示例来源:origin: com.sqlapp/sqlapp-command
this.getExceptionHandler().handle(e);
SqlFactoryRegistry sqlFactoryRegistry=dialect.getSqlFactoryRegistry();
try(Connection connection=this.getConnection()){
List<Schema> schemas=schemaReader.getAll(connection);
内容来源于网络,如有侵权,请联系作者删除!