简体   繁体   English

Mvel的编译表达式如何存储在数据库中

[英]Mvel's compiled expression how to store in database

I have to save the compiled expression from MVel in database. 我必须将编译后的表达式从MVel保存在数据库中。 So that I can use this directly to evaluate the expression. 这样我就可以直接用它来评估表达式。 How can I do that. 我怎样才能做到这一点。

所有编译的表达式都是可序列化的,因此可以保存为blob。

Wouldn't it make more sense to store it in its external source form? 将它存储在外部源形式中是不是更有意义? Parsing and construction is unlikely to be much overhead, if you already have to do database access which is much much slower. 如果您已经不得不进行速度慢得多的数据库访问,那么解析和构造就不会有太大的开销。

Storing source is readable, and it may well be more compact -- binary serialization format may or may not be compact. 存储源是可读的,它可能更紧凑 - 二进制序列化格式可能紧凑也可能不紧凑。 Default JDK serialization, for example, is very verbose since it includes lots of Java class metadata. 例如,默认的JDK序列化非常冗长,因为它包含许多Java类元数据。

So are you sure there is actual benefit from storing binary representations. 那么你确定存储二进制表示有实际的好处吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM