softwbc commented on issue #2393: Error when use "spring.jpa.hibernate.naming.physical-strategy" URL: https://github.com/apache/incubator-shardingsphere/issues/2393#issuecomment-493814006 Hi, @KomachiSion Here is my test code -- ---------------------------- -- Table structure for `t_doc_process_0` -- ---------------------------- DROP TABLE IF EXISTS `t_doc_process_0`; CREATE TABLE `t_doc_process_0` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `docId` char(32) COLLATE utf8mb4_unicode_ci NOT NULL, `docVersion` int(8) NOT NULL DEFAULT '0', `optUser` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `optUserId` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `optDept` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `optDeptId` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `optRole` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `operationId` int(1) NOT NULL DEFAULT '0', `operationDateTime` datetime DEFAULT NULL, `operationInfo` varchar(1024) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `createdBy` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updatedBy` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `cbOperationId` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `cbOperationName` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- DocProcess.java -- ---------------------------- import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import java.io.Serializable; import java.util.Date; @Entity @Table(name = "t_doc_process") public class DocProcess implements Serializable { private static final long serialVersionUID = 1L; @Id // @Column(name = "id") @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; // @Column(name = "docId") private String docId; // @Column(name = "docVersion") private int docVersion; // @Column(name = "optUser") private String optUser; // @Column(name = "optUserId") private String optUserId; // @Column(name = "optDept") private String optDept; // @Column(name = "optDeptId") private String optDeptId; // @Column(name = "optRole") private String optRole; // @Column(name = "operationId") private Integer operationId; // @Column(name = "operationDateTime") private Date operationDateTime; // @Column(name = "operationInfo") private String operationInfo; // @Column(name = "createdBy") private String createdBy; // @Column(name = "created") private Date created; // @Column(name = "updatedBy") private String updatedBy; // @Column(name = "updated") private Date updated; // @Column(name = "cbOperationId") private String cbOperationId; // @Column(name = "cbOperationName") private String cbOperationName; set and get...... } -- ---------------------------- -- DocProcessRepository.java -- ---------------------------- public interface DocProcessRepository extends JpaRepository<DocProcess,Long> { } -- ---------------------------- -- TestShardingSphere.java -- ---------------------------- @RunWith(SpringRunner.class) @SpringBootTest public class TestShardingSphere { @Autowired private DocProcessRepository docProcessRepository; @Test public void testProcessSave2() throws IOException, SQLException, URISyntaxException { DocProcess docProcess = new DocProcess(); set code...... this.docProcessRepository.save(docProcess); } }
---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
