Schéma-ověření: chybějící sloupec [event_id] v tabulce [process_event]. Nejsem si jistý, proč

0

Otázka

V mém springboot aplikace mám následující model

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

a

@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
    }
}

Spuštění aplikace, poskytuje následující chybě 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]

Modely jsou generovány pomocí intellij . Netuším, proč jsem stále tuto chybu. Jakékoliv pomoci, prosím ?

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

Nejlepší odpověď

0

Dobře to má vyřešen přidáním pojmenování strategie

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

2021-11-24 08:59:16

V jiných jazycích

Tato stránka je v jiných jazycích

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