没有持久化的 Grails 实体 [英] Grails Entity without persist

查看:13
本文介绍了没有持久化的 Grails 实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 grails 中有一个域类......我如何让 gorm 在创建数据库时忽略这个实体?就别管它了.

I have a domain class in grails... How do I get gorm to leave out this entity when it create the db? Just leave it alone.

推荐答案

如果我明白,你不想从域类创建表?如果是,请在域类中使用此代码:

If i understood, u want not create table from domain class? If yes, use this code inside domain class:

static mapWith = "none" // disable persisting into database

这篇关于没有持久化的 Grails 实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆