在我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]
这些模型所产生的使用和架构来达成. 不知道为什么我得到这一错误。 任何帮助吗?