org.tinygroup.dbrouter.impl.shardrule
类 ShardRuleByFieldValue

java.lang.Object
  继承者 org.tinygroup.dbrouter.impl.shardrule.ShardRuleByFieldValue
所有已实现的接口:
ShardRule

public class ShardRuleByFieldValue
extends Object
implements ShardRule

Created by luoguo on 14-1-22.


构造方法摘要
ShardRuleByFieldValue()
           
 
方法摘要
 List<FieldWithValues> getFieldWithValues()
           
 String getReplacedSql(Partition partition, Shard shard, String sql)
          返回替换好的SQL语句,对于在同一个schema中的用多个表进行分表的话,就需要替换SQL脚本
 boolean isMatch(Partition partition, Shard shard, String sql, Object... preparedParams)
          返回是否属于当前分片处理
 void setFieldWithValues(List<FieldWithValues> fieldWithValues)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ShardRuleByFieldValue

public ShardRuleByFieldValue()
方法详细信息

isMatch

public boolean isMatch(Partition partition,
                       Shard shard,
                       String sql,
                       Object... preparedParams)
从接口 ShardRule 复制的描述
返回是否属于当前分片处理

指定者:
接口 ShardRule 中的 isMatch
参数:
partition - 所属的分区
shard - TODO
sql - 要判断的SQL
preparedParams - Prepared Statement的参数
返回:

getReplacedSql

public String getReplacedSql(Partition partition,
                             Shard shard,
                             String sql)
从接口 ShardRule 复制的描述
返回替换好的SQL语句,对于在同一个schema中的用多个表进行分表的话,就需要替换SQL脚本

指定者:
接口 ShardRule 中的 getReplacedSql
参数:
partition - TODO
shard - TODO
返回:

getFieldWithValues

public List<FieldWithValues> getFieldWithValues()

setFieldWithValues

public void setFieldWithValues(List<FieldWithValues> fieldWithValues)


Copyright © 2006–2015 TinyGroup. All rights reserved.