ชุดรูปแบบ-การตรวจสอบ:หายไปคอลัมน์[event_id ในโต๊ะ[process_event]. ไม่แน่ใจว่าทำไม

0

คำถาม

ในของฉัน springboot แอ๊ปฉันมีคนตามนางแบบ

@Table(name = "process_event", indexes = [
    Index(name = "pe_eventId_idx", columnList = "eventId")
])
@Entity
internal class ProcessEvent {
    @EmbeddedId
    var id: ProcessEventId? = null
}

แล้ว

@Embeddable
internal class ProcessEventId : Serializable {
    @Column(name = "processId", nullable = false, length = 100)
    var processId: String? = null

    @Column(name = "eventId", nullable = false, length = 100)
    var eventId: String? = null

    override fun hashCode(): Int = Objects.hash(processId, eventId)
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other == null || Hibernate.getClass(this) != Hibernate.getClass(other)) return false

        other as ProcessEventId

        return processId == other.processId &&
                eventId == other.eventId
    }

    companion object {
        private const val serialVersionUID = 2616696968741078700L
    }
}

วิ่งแอพฯ,ทำให้ต่อไปนี้เกิดข้อผิดพลาด Failed to initialize JPA EntityManagerFactory: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing column [event_id] in table [process_event]

ที่เป็นนางแบบที่ถูกสร้างโดยใช้ intellij. ไม่รู้ว่าทำไมฉันได้ข้อผิดพลาดนี้ด้วย ช่วยได้โปรด?

hibernate kotlin spring-data-jpa
2021-11-23 18:03:48
1

คำตอบที่ดีที่สุด

0

เอาล่ะสิ่งนี้ได้รับการแก้ปัญหาโดยการเพิ่มในการตั้งชื่อแผน

jpa:
    hibernate:
      ddl-auto: validate
      naming.physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

2021-11-24 08:59:16

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................

ดังอยู่ในนี้หมวดหมู่

ดังคำถามอยู่ในนี้หมวดหมู่