如何更改 Grails 中的列名称约定?
现在我有字段“String firstName”,它转换为“first_name”,我希望“firstname”作为 Hibernate 中的默认值。有可能吗?
For now I have field "String firstName" it converted to "first_name" and i want "firstname" as default in Hibernate. Is it posible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
5.5.2.1 表和列名称
5.5.2.1 Table and Column Names
您可以更改整个项目的命名策略。从文档 https://grails.github.io/grails -doc/latest/guide/GORM.html#customNamingStrategy。
,在 DataSource.groovy 中类似这样的内容
You can change the naming strategy for the entire project. From the documentation https://grails.github.io/grails-doc/latest/guide/GORM.html#customNamingStrategy.
So, something like this in your DataSource.groovy