org.tinygroup.dbrouter.impl.shardrule
类 ShardRuleByIdAbstract

java.lang.Object
  继承者 org.tinygroup.dbrouter.impl.shardrule.ShardRuleByIdAbstract
所有已实现的接口:
ShardRule
直接已知子类:
ShardRuleByIdDifferentSchema, ShardRuleByIdSameSchema

public abstract class ShardRuleByIdAbstract
extends Object
implements ShardRule

Created by luoguo on 13-12-17.


构造方法摘要
ShardRuleByIdAbstract()
           
ShardRuleByIdAbstract(String tableName, String primaryKeyFieldName, int remainder)
           
 
方法摘要
 String getPrimaryKeyFieldName()
           
 long getRemainder()
           
 String getTableName()
           
 boolean isMatch(Partition partition, Shard shard, String sql, Object... preparedParams)
          返回是否属于当前分片处理
 void setPrimaryKeyFieldName(String primaryKeyFieldName)
           
 void setRemainder(int remainder)
           
 void setTableName(String tableName)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
从接口 org.tinygroup.dbrouter.ShardRule 继承的方法
getReplacedSql
 

构造方法详细信息

ShardRuleByIdAbstract

public ShardRuleByIdAbstract()

ShardRuleByIdAbstract

public ShardRuleByIdAbstract(String tableName,
                             String primaryKeyFieldName,
                             int remainder)
方法详细信息

getTableName

public String getTableName()

setTableName

public void setTableName(String tableName)

getPrimaryKeyFieldName

public String getPrimaryKeyFieldName()

setPrimaryKeyFieldName

public void setPrimaryKeyFieldName(String primaryKeyFieldName)

getRemainder

public long getRemainder()

setRemainder

public void setRemainder(int remainder)

isMatch

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

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


Copyright © 2006–2015 TinyGroup. All rights reserved.