Mongo - 忽略财产的持久性 [英] Mongo - Ignore property from being persisted

查看:118
本文介绍了Mongo - 忽略财产的持久性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个标准的POJO,里面有一组属性。 POJO已注释为 @Document ,以便作为文档保存在MongoDB中。

I have a standard POJO that has a set of properties in it. The POJO has been annotated as a @Document, so as to be persisted in MongoDB as a Document.

如何(注释??)我可以忽略/避免POJO中的某个属性被保留吗?

How (annotation??) can I ignore/avoid one of the properties in the POJO from being persisted?

推荐答案

@Transient 注释。请参见 http://static.springsource.org/ spring-data / data-document / docs / current / reference / html /#mapping-usage-annotations

这篇关于Mongo - 忽略财产的持久性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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