gpt4 book ai didi

hibernate - Grails 2.5至Grails 3.2 GORM 6

转载 作者:行者123 更新时间:2023-12-02 14:06:00 26 4
gpt4 key购买 nike

Hibernate的GORM 6.1.8.RELEASE是否需要对域类进行任何更改?

域映射中的joinTableGORM的最新添加内容吗?

我将域类从正常的Grails 2.5.1项目复制到了Grails 3.2项目。当我使用"dbCreate: 'validate'"启动骨骼应用程序时,出现以下错误:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'methodValidationPostProcessor' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Unsatisfied dependency expressed through method 'methodValidationPostProcessor' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateDatastoreServiceRegistry': Cannot resolve reference to bean 'hibernateDatastore' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateDatastore': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.grails.orm.hibernate.HibernateDatastore]: Constructor threw exception; nested exception is org.hibernate.MappingException: Foreign key (FK56o1sv2813gshwyyok919a6gp:library_document_attachments [])) must have same number of columns as the referenced primary key (library_document [id])



我在关联中没有组合键或任何自定义映射。
class LibraryDocument extends Trackable {

// Attributes
...

// Relationships
Attachment latestVersion
static belongsTo = [...]

SortedSet attachments
static hasMany = [attachments: Attachment]
...
}

项目版本信息:
grailsVersion=3.3.2
gormVersion=6.1.8.RELEASE
gradleWrapperVersion=3.5

最佳答案

Does GORM 6.1.8.RELEASE for Hibernate require any changes to domain classes?



答案取决于您的应用程序中的许多因素。许多域类不需要更改。

Is joinTable in the domain mapping a recent addition to GORM?



不。我们补充说,大约10年前,它已包含在1.0中。 https://github.com/grails/grails-core/commit/de590be6452715a119931d26bcc50c6a72e96170

关于hibernate - Grails 2.5至Grails 3.2 GORM 6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48326531/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com