Search in sources :

Example 1 with SqlContext

use of com.ctrip.platform.dal.dao.datasource.log.SqlContext in project dal by ctripcorp.

the class ClusterDataSource method createSqlContext.

@Override
protected SqlContext createSqlContext() {
    SqlContext context = id.createSqlContext();
    if (context instanceof ClusterDbSqlContext) {
        ((ClusterDbSqlContext) context).populateShard(getShardIndex());
        ((ClusterDbSqlContext) context).populateRole(DatabaseRole.MASTER);
    }
    return context;
}
Also used : SqlContext(com.ctrip.platform.dal.dao.datasource.log.SqlContext) ClusterDbSqlContext(com.ctrip.platform.dal.dao.datasource.log.ClusterDbSqlContext) ClusterDbSqlContext(com.ctrip.platform.dal.dao.datasource.log.ClusterDbSqlContext)

Aggregations

ClusterDbSqlContext (com.ctrip.platform.dal.dao.datasource.log.ClusterDbSqlContext)1 SqlContext (com.ctrip.platform.dal.dao.datasource.log.SqlContext)1