[英]grails domain class afterload saving the values in DB
Hi I need to decrypt the values, before showing to UI. 嗨,我需要解密的值,然后显示给用户界面。 for the same i trying to decrypt the values in Domain class afterLoad() event. 同样,我试图解密Domain类afterLoad()事件中的值。 however those decrypted values getting saved in DB. 但是,这些解密值将保存在数据库中。 Please tell me how to stop that? 请告诉我如何制止?
You can just implement getters for fields, decrypt and return values in getters. 您可以只实现字段的getter,在getter中解密并返回值。 And still simply access values by field name. 而且仍然只是通过字段名称访问值。 It will solve your problem and IMHO the better way. 它将解决您的问题和恕我直言更好的方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.