Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORA-00972: identifier is too long. Oracle 11g #654

Closed
CrownlessX opened this issue Oct 8, 2019 · 2 comments
Closed

ORA-00972: identifier is too long. Oracle 11g #654

CrownlessX opened this issue Oct 8, 2019 · 2 comments
Labels

Comments

@CrownlessX
Copy link

CrownlessX commented Oct 8, 2019

I'm trying to create many-to-one relation.
But alwas got issue with "identifier is too long" as exposed automatically creates
too long foreign key(, but Oracle 11g got limitation - 30 characters.
Could you help me to bypass this issue?
I saw few issues reported here with such problem/suggestion, but don't know if there are any workaround.

@Tapac
Copy link
Contributor

Tapac commented Oct 9, 2019

Could you provide sample tables mapping which fails on create?

@Tapac Tapac added the bug label Oct 9, 2019
@CrownlessX
Copy link
Author

CrownlessX commented Oct 9, 2019

Transaction attempt #0 failed: java.sql.SQLSyntaxErrorException: ORA-00972: identifier is too long
. Statement(s): CREATE TABLE TBL_CONTAINER (ID NUMBER(12) PRIMARY KEY, FK_CUSTOMER_ID VARCHAR(100) NOT NULL, CONSTRAINT FK_TBL_CONTAINER_FK_CUSTOMER_ID_CUSTOMER_ID FOREIGN KEY (FK_CUSTOMER_ID) REFERENCES TBL_STATUS(CUSTOMER_ID) ON DELETE CASCADE)

object ContainerTable : IntIdTable("TBL_CONTAINER") {
    val customerId = reference("fk_customer_id", StatusTable, onDelete = ReferenceOption.CASCADE)

}

class Container(id: EntityID<Int>) : IntEntity(id) {
    companion object : IntEntityClass<Container>(ContainerTable)

    var customerId by Status referencedOn ContainerTable.customerId
}

class Status(id: EntityID<String>) : Entity<String>(id) {
    companion object : EntityClass<String, Status>(StatusTable)

}

object StatusTable : IdTable<String>("TBL_STATUS") {
    override val id = varchar("customer_id", 100).entityId().primaryKey()
}

As far as i know, in new versions of Oracle this limitation(max 30 symbols per name) was changed.

I found workaround - create tables manually and use after, but I would prefer to remove manual steps.

@Tapac Tapac closed this as completed Oct 12, 2019
Tapac added a commit that referenced this issue Oct 13, 2019
identifierLengthLimit should not be lazy initialized
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants