我有一张名为" Project" (由引号括起来的表名,HANA DB中的命名约定)。
当我尝试使用带有以下代码的hibernate创建序列时,封闭的引号将被反引号替换。我希望用引号括起序列名称。
代码:
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="PROJECT_SEQ")
@SequenceGenerator(name="PROJECT_SEQ",sequenceName="\"MY_SCHEMA\".\"com.project.sequence.Project_SEQ\"",allocationSize=10)
@Column(name="ID", columnDefinition="INTEGER64")
private long id;
例外:
org.springframework.dao.InvalidDataAccessResourceUsageException: could not prepare statement;
SQL [select `MY_SCHEMA"."com.project.sequence.Project_SEQ`.nextval from dummy];
nested exception is org.hibernate.exception.SQLGrammarException: could not prepare statement
期望:
下面提到的序列名称应该由hibernate使用
select "MY_SCHEMA"."com.project.sequence.Project_SEQ".nextval from dummy