You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/07/05 05:36:16 UTC
[GitHub] [shardingsphere] Swastyy opened a new pull request, #18856: class-based-sharding-spring-boot-jpa-example
Swastyy opened a new pull request, #18856:
URL: https://github.com/apache/shardingsphere/pull/18856
Fixes #15713
Changes proposed in this pull request:
-
-
-
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #18856: class-based-sharding-spring-boot-jpa-example
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #18856:
URL: https://github.com/apache/shardingsphere/pull/18856#discussion_r927258608
##########
examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-jpa-example/src/main/resources/application-sharding-tables.properties:
##########
@@ -0,0 +1,54 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+
+spring.shardingsphere.datasource.names=ds
+
+spring.shardingsphere.datasource.ds.type=com.zaxxer.hikari.HikariDataSource
+spring.shardingsphere.datasource.ds.driver-class-name=com.mysql.jdbc.Driver
+spring.shardingsphere.datasource.ds.jdbc-url=jdbc:mysql://127.0.0.1:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
+spring.shardingsphere.datasource.ds.username=root
+spring.shardingsphere.datasource.ds.password=
+
+spring.shardingsphere.rules.sharding.tables.t_order.actual-data-nodes=ds.t_order_$->{0..1}
+spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-column=order_id
+spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-algorithm-name=t-order-class-based
+
+spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.column=order_id
+spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.key-generator-name=snowflake
+
+spring.shardingsphere.rules.sharding.tables.t_order_item.actual-data-nodes=ds.t_order_item_$->{0..1}
+spring.shardingsphere.rules.sharding.tables.t_order_item.table-strategy.standard.sharding-column=order_id
+spring.shardingsphere.rules.sharding.tables.t_order_item.table-strategy.standard.sharding-algorithm-name=t-order-item-class-based
+
+spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.column=order_item_id
+spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
+
+spring.shardingsphere.rules.sharding.binding-tables[0]=t_order,t_order_item
+spring.shardingsphere.rules.sharding.broadcast-tables=t_address
+
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.type=CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.props.strategy=standard
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.props.algorithmClassName=org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.jpa.fixture.ClassBasedOrderStandardShardingAlgorithmFixture
Review Comment:
Hi @Swastyy , any update?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] Swastyy commented on a diff in pull request #18856: class-based-sharding-spring-boot-jpa-example
Posted by GitBox <gi...@apache.org>.
Swastyy commented on code in PR #18856:
URL: https://github.com/apache/shardingsphere/pull/18856#discussion_r921794904
##########
examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-jpa-example/src/main/resources/application-sharding-tables.properties:
##########
@@ -0,0 +1,54 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+
+spring.shardingsphere.datasource.names=ds
+
+spring.shardingsphere.datasource.ds.type=com.zaxxer.hikari.HikariDataSource
+spring.shardingsphere.datasource.ds.driver-class-name=com.mysql.jdbc.Driver
+spring.shardingsphere.datasource.ds.jdbc-url=jdbc:mysql://127.0.0.1:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
+spring.shardingsphere.datasource.ds.username=root
+spring.shardingsphere.datasource.ds.password=
+
+spring.shardingsphere.rules.sharding.tables.t_order.actual-data-nodes=ds.t_order_$->{0..1}
+spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-column=order_id
+spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-algorithm-name=t-order-class-based
+
+spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.column=order_id
+spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.key-generator-name=snowflake
+
+spring.shardingsphere.rules.sharding.tables.t_order_item.actual-data-nodes=ds.t_order_item_$->{0..1}
+spring.shardingsphere.rules.sharding.tables.t_order_item.table-strategy.standard.sharding-column=order_id
+spring.shardingsphere.rules.sharding.tables.t_order_item.table-strategy.standard.sharding-algorithm-name=t-order-item-class-based
+
+spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.column=order_item_id
+spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
+
+spring.shardingsphere.rules.sharding.binding-tables[0]=t_order,t_order_item
+spring.shardingsphere.rules.sharding.broadcast-tables=t_address
+
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.type=CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.props.strategy=standard
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.props.algorithmClassName=org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.jpa.fixture.ClassBasedOrderStandardShardingAlgorithmFixture
Review Comment:
yes, @RaigorJiang these 3 `ClassBasedDataSourceStandardShardingAlgorithmFixture`, `ClassBasedOrderStandardShardingAlgorithmFixture`, `ClassBasedOrderItemStandardShardingAlgorithmFixture` are I need to implement here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #18856: class-based-sharding-spring-boot-jpa-example
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #18856:
URL: https://github.com/apache/shardingsphere/pull/18856#discussion_r921751630
##########
examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-jpa-example/src/main/resources/application-sharding-tables.properties:
##########
@@ -0,0 +1,54 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+
+spring.shardingsphere.datasource.names=ds
+
+spring.shardingsphere.datasource.ds.type=com.zaxxer.hikari.HikariDataSource
+spring.shardingsphere.datasource.ds.driver-class-name=com.mysql.jdbc.Driver
+spring.shardingsphere.datasource.ds.jdbc-url=jdbc:mysql://127.0.0.1:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
+spring.shardingsphere.datasource.ds.username=root
+spring.shardingsphere.datasource.ds.password=
+
+spring.shardingsphere.rules.sharding.tables.t_order.actual-data-nodes=ds.t_order_$->{0..1}
+spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-column=order_id
+spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-algorithm-name=t-order-class-based
+
+spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.column=order_id
+spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.key-generator-name=snowflake
+
+spring.shardingsphere.rules.sharding.tables.t_order_item.actual-data-nodes=ds.t_order_item_$->{0..1}
+spring.shardingsphere.rules.sharding.tables.t_order_item.table-strategy.standard.sharding-column=order_id
+spring.shardingsphere.rules.sharding.tables.t_order_item.table-strategy.standard.sharding-algorithm-name=t-order-item-class-based
+
+spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.column=order_item_id
+spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
+
+spring.shardingsphere.rules.sharding.binding-tables[0]=t_order,t_order_item
+spring.shardingsphere.rules.sharding.broadcast-tables=t_address
+
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.type=CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.props.strategy=standard
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.props.algorithmClassName=org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.jpa.fixture.ClassBasedOrderStandardShardingAlgorithmFixture
Review Comment:
Hi @Swastyy
The class may be not exist in this module?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on pull request #18856: class-based-sharding-spring-boot-jpa-example
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on PR #18856:
URL: https://github.com/apache/shardingsphere/pull/18856#issuecomment-1193282077
> yeah, and sorry for completing it so late. π
Don't worry, It's OK.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on pull request #18856: class-based-sharding-spring-boot-jpa-example
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on PR #18856:
URL: https://github.com/apache/shardingsphere/pull/18856#issuecomment-1174995949
@Swastyy
Can you run a test of this example?
Because I found that the specified algorithm implementation class belongs to the `mybatis` module.
E.g:
`org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.mybatis.fixture.ClassBasedDataSourceStandardShardingAlgorithmFixture`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] Swastyy commented on a diff in pull request #18856: class-based-sharding-spring-boot-jpa-example
Posted by GitBox <gi...@apache.org>.
Swastyy commented on code in PR #18856:
URL: https://github.com/apache/shardingsphere/pull/18856#discussion_r913640251
##########
examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-jpa-example/src/main/java/org/apache/shardingsphere/example/extension/classbased/sharding/spring/boot/jpa/ClassBasedShardingSpringBootJpaExample.java:
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+package org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.jpa;
+
+import org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate;
+import org.apache.shardingsphere.example.core.api.service.ExampleService;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.domain.EntityScan;
+import org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.annotation.ComponentScan;
+
+import java.sql.SQLException;
+
+@ComponentScan("org.apache.shardingsphere.example.core.jpa")
+@EntityScan(basePackages = "org.apache.shardingsphere.example.core.jpa.entity")
+@SpringBootApplication(exclude = JtaAutoConfiguration.class)
+public class ClassBasedShardingSpringBootJpaExample {
+
+ public static void main(final String[] args) throws SQLException {
+ try (ConfigurableApplicationContext applicationContext = SpringApplication.run(ClassBasedShardingSpringBootJpaExample.class, args)) {
+ ExampleExecuteTemplate.run(applicationContext.getBean(ExampleService.class));
+ }
+ }
+}
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] Swastyy commented on a diff in pull request #18856: class-based-sharding-spring-boot-jpa-example
Posted by GitBox <gi...@apache.org>.
Swastyy commented on code in PR #18856:
URL: https://github.com/apache/shardingsphere/pull/18856#discussion_r927274844
##########
examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-jpa-example/src/main/resources/application-sharding-tables.properties:
##########
@@ -0,0 +1,54 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+
+spring.shardingsphere.datasource.names=ds
+
+spring.shardingsphere.datasource.ds.type=com.zaxxer.hikari.HikariDataSource
+spring.shardingsphere.datasource.ds.driver-class-name=com.mysql.jdbc.Driver
+spring.shardingsphere.datasource.ds.jdbc-url=jdbc:mysql://127.0.0.1:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
+spring.shardingsphere.datasource.ds.username=root
+spring.shardingsphere.datasource.ds.password=
+
+spring.shardingsphere.rules.sharding.tables.t_order.actual-data-nodes=ds.t_order_$->{0..1}
+spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-column=order_id
+spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-algorithm-name=t-order-class-based
+
+spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.column=order_id
+spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.key-generator-name=snowflake
+
+spring.shardingsphere.rules.sharding.tables.t_order_item.actual-data-nodes=ds.t_order_item_$->{0..1}
+spring.shardingsphere.rules.sharding.tables.t_order_item.table-strategy.standard.sharding-column=order_id
+spring.shardingsphere.rules.sharding.tables.t_order_item.table-strategy.standard.sharding-algorithm-name=t-order-item-class-based
+
+spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.column=order_item_id
+spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
+
+spring.shardingsphere.rules.sharding.binding-tables[0]=t_order,t_order_item
+spring.shardingsphere.rules.sharding.broadcast-tables=t_address
+
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.type=CLASS_BASED
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.props.strategy=standard
+spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-class-based.props.algorithmClassName=org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.jpa.fixture.ClassBasedOrderStandardShardingAlgorithmFixture
Review Comment:
Hi, I will complete it soon.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] Swastyy commented on pull request #18856: class-based-sharding-spring-boot-jpa-example
Posted by GitBox <gi...@apache.org>.
Swastyy commented on PR #18856:
URL: https://github.com/apache/shardingsphere/pull/18856#issuecomment-1193281545
> @Swastyy Merged, thank you!
yeah, and sorry for completing it so late. π
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on pull request #18856: class-based-sharding-spring-boot-jpa-example
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on PR #18856:
URL: https://github.com/apache/shardingsphere/pull/18856#issuecomment-1174965580
@Swastyy
The algorithm type should be `CLASS_BASED`, but there just `INLINE` for now.
Ref: https://github.com/apache/shardingsphere/blob/master/examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-mybatis-example/src/main/resources/application-sharding-tables.properties
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on pull request #18856: class-based-sharding-spring-boot-jpa-example
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on PR #18856:
URL: https://github.com/apache/shardingsphere/pull/18856#issuecomment-1175033410
> Hi @RaigorJiang , after opening examples folder which command to run it particular?
1. example is a project, imported separately in IDE
2. Run the public class which has a main method in the target module, such as the ClassBasedShardingSpringBootJpaExample you added
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] codecov-commenter commented on pull request #18856: class-based-sharding-spring-boot-jpa-example
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #18856:
URL: https://github.com/apache/shardingsphere/pull/18856#issuecomment-1174663034
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18856?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#18856](https://codecov.io/gh/apache/shardingsphere/pull/18856?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (cd40678) into [master](https://codecov.io/gh/apache/shardingsphere/commit/715ea2365cb00a2d4bf1d7f877edcf3a6473bdd2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (715ea23) will **increase** coverage by `0.00%`.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## master #18856 +/- ##
=========================================
Coverage 59.27% 59.27%
Complexity 2281 2281
=========================================
Files 3756 3756
Lines 54425 54425
Branches 9208 9208
=========================================
+ Hits 32258 32261 +3
+ Misses 19454 19451 -3
Partials 2713 2713
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/18856?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Ξ | |
|---|---|---|
| [...d/text/distsql/ral/common/hint/HintSourceType.java](https://codecov.io/gh/apache/shardingsphere/pull/18856/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvcmFsL2NvbW1vbi9oaW50L0hpbnRTb3VyY2VUeXBlLmphdmE=) | `42.85% <0.00%> (+42.85%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18856?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Ξ = absolute <relative> (impact)`, `ΓΈ = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18856?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [715ea23...cd40678](https://codecov.io/gh/apache/shardingsphere/pull/18856?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang merged pull request #18856: class-based-sharding-spring-boot-jpa-example
Posted by GitBox <gi...@apache.org>.
RaigorJiang merged PR #18856:
URL: https://github.com/apache/shardingsphere/pull/18856
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #18856: class-based-sharding-spring-boot-jpa-example
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #18856:
URL: https://github.com/apache/shardingsphere/pull/18856#discussion_r913613663
##########
examples/shardingsphere-jdbc-example/single-feature-example/extension-example/custom-sharding-algortihm-example/class-based-sharding-algorithm-example/class-based-sharding-spring-boot-jpa-example/src/main/java/org/apache/shardingsphere/example/extension/classbased/sharding/spring/boot/jpa/ClassBasedShardingSpringBootJpaExample.java:
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+package org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.jpa;
+
+import org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate;
+import org.apache.shardingsphere.example.core.api.service.ExampleService;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.domain.EntityScan;
+import org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.annotation.ComponentScan;
+
+import java.sql.SQLException;
+
+@ComponentScan("org.apache.shardingsphere.example.core.jpa")
+@EntityScan(basePackages = "org.apache.shardingsphere.example.core.jpa.entity")
+@SpringBootApplication(exclude = JtaAutoConfiguration.class)
+public class ClassBasedShardingSpringBootJpaExample {
+
+ public static void main(final String[] args) throws SQLException {
+ try (ConfigurableApplicationContext applicationContext = SpringApplication.run(ClassBasedShardingSpringBootJpaExample.class, args)) {
+ ExampleExecuteTemplate.run(applicationContext.getBean(ExampleService.class));
+ }
+ }
+}
Review Comment:
Please keep a blank line at the end of file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] Swastyy commented on pull request #18856: class-based-sharding-spring-boot-jpa-example
Posted by GitBox <gi...@apache.org>.
Swastyy commented on PR #18856:
URL: https://github.com/apache/shardingsphere/pull/18856#issuecomment-1175011086
> @Swastyy Can you run a test of this example? Because I found that the specified algorithm implementation class belongs to the `mybatis` module.
>
> E.g: `org.apache.shardingsphere.example.extension.classbased.sharding.spring.boot.mybatis.fixture.ClassBasedDataSourceStandardShardingAlgorithmFixture`
Hi @RaigorJiang , after opening examples folder which command to run it particular?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on pull request #18856: class-based-sharding-spring-boot-jpa-example
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on PR #18856:
URL: https://github.com/apache/shardingsphere/pull/18856#issuecomment-1193271646
@Swastyy Merged, thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org