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 2019/11/25 14:14:56 UTC

[GitHub] [incubator-shardingsphere] larry0592 edited a comment on issue #3562: Create a foreign key using ddl,Execute twice version: 4.0.0-RC2

larry0592 edited a comment on issue #3562: Create a foreign key using ddl,Execute twice version: 4.0.0-RC2
URL: https://github.com/apache/incubator-shardingsphere/issues/3562#issuecomment-555986823
 
 
   This is application.properties 
   
   ```
   #MySql配置
   spring.shardingsphere.datasource.names=ds
   spring.shardingsphere.datasource.ds.type=com.alibaba.druid.pool.DruidDataSource
   spring.shardingsphere.datasource.ds.driver-class-name=com.mysql.cj.jdbc.Driver
   spring.shardingsphere.datasource.ds.url=jdbc:mysql://localhost:3306/larry-dev?characterEncoding=utf8&serverTimezone=GMT&nullCatalogMeansCurrent=true
   spring.shardingsphere.datasource.ds.username=root
   spring.shardingsphere.datasource.ds.password=sa123
   spring.shardingsphere.datasource.ds.initial-size=8
   spring.shardingsphere.datasource.ds.max-active=16
   
   #JPA
   spring.jpa.properties.hibernate.hbm2ddl.auto=update
   spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
   spring.jpa.properties.hibernate.show_sql=false
   
   # 是否显示SQL语句
   spring.shardingsphere.props.sql.show=true
   
   #分表策略
   spring.shardingsphere.sharding.tables.person.actual-data-nodes=ds.person_$->{0..99}
   spring.shardingsphere.sharding.tables.person.table-strategy.inline.sharding-column=company_id
   spring.shardingsphere.sharding.tables.person.table-strategy.inline.algorithm-expression=person_$->{Math.abs(company_id.hashCode())% 100 }
   spring.shardingsphere.sharding.tables.person.key-generator.column=company_id
   spring.shardingsphere.sharding.tables.person.key-generator.type=SNOWFLAKE
   spring.shardingsphere.sharding.tables.person.key-generator.props.worker.id=123
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services