spring - How to declare a GORM domain class without Grails?
问题描述
I'm making a project on Groovy + Spring using GORM, without implementing Grails. In order to do so, I'm following the guide that Grails provide (http://guides.grails.org/gorm-without-grails/guide/index.html). And even when I have the same Domains As them, when I run it and it bootstraps the data, it throws an exception saying that
Either class [domains.Manufacturer] is not a domain class or GORM has not been initialized correctly or has already been shutdown. Ensure GORM is loaded and configured correctly before calling any methods on a GORM entity.
and this is my Manufacter.groovy file:
import grails.gorm.annotation.Entity
import groovy.transform.ToString
import org.grails.datastore.gorm.GormEntity
@ToString
@Entity
class Manufacturer implements GormEntity<Manufacturer> {
String name
static hasMany = [vehicles: Vehicle]
static constraints = {
name blank: false
}
}
Any idea of why this error happens even though I have followed the exact same steps as them? Does it has something to do with dependencies version?
Thank you very much in advance
解决方案
推荐阅读
- android - 我无法使用 TouchImageView 依赖项
- javascript - 视频墙布局
- php - Lumen - 分页和结果编辑
- visual-studio-code - VS Code 删除侧边栏标题符号
- amazon-web-services - AWS API Gateway 要求对请求 URL 进行两次编码
- android - 当应用程序处于终止/后台状态时,相机不拍照
- c++ - QT Creator https 请求在 VM 上不起作用
- php - 自定义插件干扰订单“PHP”
- python - 在 Python 中递归使用 ord()
- node.js - 如何解决 socket.io laravel 和 nodejs 信令应用程序中的 cors 错误