oracle.jdbc.OracleDatabaseException:ORA-00972:标识符太长 [英] oracle.jdbc.OracleDatabaseException: ORA-00972: identifier is too long
问题描述
这是我的Entity类
Here is my Entity class
@Entity
public class ProjectDetails {
@Id
private int projectId;
private String projectDescription;
private int languageId;
}
@Entity
public class Project {
@Id
private int projectId;
private String projectName;
private LocalDate projectStartDate;
private LocalDate projectEndDate;
private String projectStatus;
@OneToOne
private ProjectDetails projectDetails;
}
我有这样的JPA方法
List<Projects> findProjectsByProjectsIdAndProjectDetailsLanguageId(int projectId, int languageId)
在执行过程中,我遇到以下错误.
While executing I am getting below error.
oracle.jdbc.OracleDatabaseException: ORA-00972: identifier is too long
已经添加了物理状态命名配置
Already added Physical-statergy naming configuration
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
我阅读了有关隐式策略的内容,但不确定.知道如何解决该问题吗?
I read about implicit-strategy but not sure about it. Any idea how to solve the issue?
推荐答案
来自文档:
From the 2.8.1 Database Object Naming Rules taken from the Oracle DB 12.2 documentation:
-
标识符名称的最大长度取决于COMPATIBLE初始化参数的值.
The maximum length of identifier names depends on the value of the COMPATIBLE initialization parameter.
-
如果COMPATIBLE的值设置为12.2或更高,则名称的长度必须在1到128个字节之间,但以下情况除外:
If COMPATIBLE is set to a value of 12.2 or higher, then names must be from 1 to 128 bytes long with these exceptions:
-
数据库名称限制为8个字节.
Names of databases are limited to 8 bytes.
磁盘组,可插拔数据库(PDB),回滚段,表空间和表空间集的名称限制为30个字节.
Names of disk groups, pluggable databases (PDBs), rollback segments, tablespaces, and tablespace sets are limited to 30 bytes.
对于此版本,标识符太长.唯一的方法是使用较短的名称或将COMPATIBLE
降级为较低的版本.
For this version, the identifier is simply too long. The only way to go is to either use a shorter name or downgrade COMPATIBLE
to a lower version.
这篇关于oracle.jdbc.OracleDatabaseException:ORA-00972:标识符太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!