public TableRule getTableRule ( final String logicTableName ) { Optional < TableRule > tableRule = findTableRule ( logicTableName ) ; if ( tableRule . isPresent ( ) ) { return tableRule . get ( ) ; } if ( isBroadcastTable ( logicTableName ) ) { return new TableRule ( shardingDataSourceNames . getDataSourceNames ( ) , logicTableName ) ; } if ( ! Strings . isNullOrEmpty ( shardingDataSourceNames . getDefaultDataSourceName ( ) ) ) { return new TableRule ( shardingDataSourceNames . getDefaultDataSourceName ( ) , logicTableName ) ; } throw new ShardingConfigurationException ( "Cannot find table rule and default data source with logic table: '%s'" , logicTableName ) ; }
Get table rule .