Loading sharding-jdbc-example/spring-namespace-example/spring-namespace-jpa-example/src/main/java/io/shardingsphere/example/spring/namespace/jpa/fixture/algorithm/PreciseModuloTableShardingAlgorithm.java→sharding-jdbc-example/spring-namespace-nodep-example/spring-namespace-nodep-jpa-example/src/main/java/io/shardingsphere/example/spring/namespace/jpa/fixture/algorithm/PreciseModuloTableShardingAlgorithm.java +0 −0 File moved. View file sharding-jdbc-example/spring-namespace-example/spring-namespace-mybatis-example/src/main/java/io/shardingsphere/example/spring/namespace/mybatis/fixtrue/algorithm/PreciseModuloTableShardingAlgorithm.java→sharding-jdbc-example/spring-namespace-nodep-example/spring-namespace-nodep-mybatis-example/src/main/java/io/shardingsphere/example/spring/namespace/mybatis/fixtrue/algorithm/PreciseModuloTableShardingAlgorithm.java +0 −0 File moved. View file sharding-jdbc-example/spring-namespace-orche-example/spring-namespace-orche-jpa-example/src/main/java/io/shardingsphere/example/spring/namespace/jpa/fixture/algorithm/PreciseModuloTableShardingAlgorithm.java 0 → 100644 +36 −0 Original line number Diff line number Diff line /* * Copyright 2016-2018 shardingsphere.io. * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * </p> */ package io.shardingsphere.example.spring.namespace.jpa.fixture.algorithm; import io.shardingsphere.api.algorithm.sharding.PreciseShardingValue; import io.shardingsphere.api.algorithm.sharding.standard.PreciseShardingAlgorithm; import java.util.Collection; public final class PreciseModuloTableShardingAlgorithm implements PreciseShardingAlgorithm<Long> { @Override public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Long> shardingValue) { for (String each : availableTargetNames) { if (each.endsWith(shardingValue.getValue() % 2 + "")) { return each; } } throw new UnsupportedOperationException(); } } sharding-jdbc-example/spring-namespace-orche-example/spring-namespace-orche-mybatis-example/src/main/java/io/shardingsphere/example/spring/namespace/mybatis/fixtrue/algorithm/PreciseModuloTableShardingAlgorithm.java 0 → 100644 +36 −0 Original line number Diff line number Diff line /* * Copyright 2016-2018 shardingsphere.io. * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * </p> */ package io.shardingsphere.example.spring.namespace.mybatis.fixtrue.algorithm; import io.shardingsphere.api.algorithm.sharding.PreciseShardingValue; import io.shardingsphere.api.algorithm.sharding.standard.PreciseShardingAlgorithm; import java.util.Collection; public final class PreciseModuloTableShardingAlgorithm implements PreciseShardingAlgorithm<Long> { @Override public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Long> shardingValue) { for (String each : availableTargetNames) { if (each.endsWith(shardingValue.getValue() % 2 + "")) { return each; } } throw new UnsupportedOperationException(); } } Loading
sharding-jdbc-example/spring-namespace-example/spring-namespace-jpa-example/src/main/java/io/shardingsphere/example/spring/namespace/jpa/fixture/algorithm/PreciseModuloTableShardingAlgorithm.java→sharding-jdbc-example/spring-namespace-nodep-example/spring-namespace-nodep-jpa-example/src/main/java/io/shardingsphere/example/spring/namespace/jpa/fixture/algorithm/PreciseModuloTableShardingAlgorithm.java +0 −0 File moved. View file
sharding-jdbc-example/spring-namespace-example/spring-namespace-mybatis-example/src/main/java/io/shardingsphere/example/spring/namespace/mybatis/fixtrue/algorithm/PreciseModuloTableShardingAlgorithm.java→sharding-jdbc-example/spring-namespace-nodep-example/spring-namespace-nodep-mybatis-example/src/main/java/io/shardingsphere/example/spring/namespace/mybatis/fixtrue/algorithm/PreciseModuloTableShardingAlgorithm.java +0 −0 File moved. View file
sharding-jdbc-example/spring-namespace-orche-example/spring-namespace-orche-jpa-example/src/main/java/io/shardingsphere/example/spring/namespace/jpa/fixture/algorithm/PreciseModuloTableShardingAlgorithm.java 0 → 100644 +36 −0 Original line number Diff line number Diff line /* * Copyright 2016-2018 shardingsphere.io. * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * </p> */ package io.shardingsphere.example.spring.namespace.jpa.fixture.algorithm; import io.shardingsphere.api.algorithm.sharding.PreciseShardingValue; import io.shardingsphere.api.algorithm.sharding.standard.PreciseShardingAlgorithm; import java.util.Collection; public final class PreciseModuloTableShardingAlgorithm implements PreciseShardingAlgorithm<Long> { @Override public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Long> shardingValue) { for (String each : availableTargetNames) { if (each.endsWith(shardingValue.getValue() % 2 + "")) { return each; } } throw new UnsupportedOperationException(); } }
sharding-jdbc-example/spring-namespace-orche-example/spring-namespace-orche-mybatis-example/src/main/java/io/shardingsphere/example/spring/namespace/mybatis/fixtrue/algorithm/PreciseModuloTableShardingAlgorithm.java 0 → 100644 +36 −0 Original line number Diff line number Diff line /* * Copyright 2016-2018 shardingsphere.io. * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * </p> */ package io.shardingsphere.example.spring.namespace.mybatis.fixtrue.algorithm; import io.shardingsphere.api.algorithm.sharding.PreciseShardingValue; import io.shardingsphere.api.algorithm.sharding.standard.PreciseShardingAlgorithm; import java.util.Collection; public final class PreciseModuloTableShardingAlgorithm implements PreciseShardingAlgorithm<Long> { @Override public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Long> shardingValue) { for (String each : availableTargetNames) { if (each.endsWith(shardingValue.getValue() % 2 + "")) { return each; } } throw new UnsupportedOperationException(); } }