Grails:.save(flush:flush, insert:true) 与 .save(flush:true) 有何不同

标签 grails insert spring-security save flush

在spring security生成类UserRoleSecUserSecRole (你可以随便叫它)有一个命令可以创建 new UserRole()并用 .save(flush:flush, insert:true) 保存它

这意味着什么?它与 .save(flush:true) 有何不同?

最佳答案

来自 Grails docs :

insert (optional) - When set to true will force Hibernate to do a SQL INSERT, this is useful in certain situations when legacy databases (such as AS/400) are involved and Hibernate cannot detect whether to do an INSERT or an UPDATE

关于Grails:.save(flush:flush, insert:true) 与 .save(flush:true) 有何不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9301395/

相关文章:

c# - Dapper - 使用嵌套对象插入

java - 哪种 Spring 安全身份验证方案适合移动和 Web 应用程序的 REST API?

docker - docker中的Grails应用程序,安装spring-security插件?

Grails g :select optionValue

jquery - grails 中带有 2 个按钮的 div

MYSQL:更新现有列中的所有值

javascript - 使用硬编码 token 访问 spring boot Rest 端点?

windows - Grails 2.0.3 错误从 Windows7 中的命令行启动

grails - Grails 3.3.0/Gorm:如何通过联接进行查询

python - [Python]拆分csv文件的元素并插入mysql