oracle.jdbc.OracleDatabaseException: ORA-00972: identifier is too long

℡╲_俬逩灬. 提交于 2020-04-06 22:26:33

问题


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;


}

I have a JPA method like this

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?


回答1:


From the 2.8.1 Database Object Naming Rules taken from the Oracle DB 12.2 documentation:

  1. The maximum length of identifier names depends on the value of the COMPATIBLE initialization parameter.

    • 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:

      • Names of databases are limited to 8 bytes.

      • Names of disk groups, pluggable databases (PDBs), rollback segments, tablespaces, and tablespace sets are limited to 30 bytes.

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.



来源:https://stackoverflow.com/questions/61010482/oracle-jdbc-oracledatabaseexception-ora-00972-identifier-is-too-long

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!