As a further investigation, I changed the id in Person class to the following type:
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private Long id;
and got the same error: Oct. 05, 2022 9:20:53 A.M. org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl handleException WARN: GenerationTarget encountered exception accepting command : Error executing DDL "create table PersonsTable (id null not null,address null,name null,nickname null) PRIMARY KEY (id)" via JDBC Statement org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table PersonsTable (id null not null,address null,name null,nickname null) PRIMARY KEY (id)" via JDBC Statement {{ at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67)}} {{ at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlString(AbstractSchemaMigrator.java:587)}} {{ at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlStrings(AbstractSchemaMigrator.java:532)}} {{ at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.createTable(AbstractSchemaMigrator.java:307)}} {{ at org.hibernate.tool.schema.internal.GroupedSchemaMigratorImpl.performTablesMigration(GroupedSchemaMigratorImpl.java:79)}} {{ at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:225)}} {{ at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:126)}} {{ at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:284)}} {{ at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.lambda$process$5(SchemaManagementToolCoordinator.java:143)}} {{ at java.base/java.util.HashMap.forEach(HashMap.java:1337)}} {{ at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:140)}} {{ at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:333)}} {{ at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:415)}} {{ at org.hibernate.boot.internal.MetadataImpl.buildSessionFactory(MetadataImpl.java:186)}} {{ at com.example.spanner.HibernateSampleApplication.main(HibernateSampleApplication.java:39)}} Caused by: com.google.cloud.spanner.jdbc.JdbcSqlExceptionFactory$JdbcSqlExceptionImpl: INVALID_ARGUMENT: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Error parsing Spanner DDL statement: create table PersonsTable (id null not null,address null,name null,nickname null) PRIMARY KEY (id) : Syntax error on line 1, column 31: Encountered 'null' while parsing: column_type {{ at com.google.cloud.spanner.jdbc.JdbcSqlExceptionFactory.of(JdbcSqlExceptionFactory.java:221)}} {{ at com.google.cloud.spanner.jdbc.AbstractJdbcStatement.execute(AbstractJdbcStatement.java:263)}} |