寻找可变对象的 Hibernate UserType 方法的详细解释
我正在 Hibernate 中创建一个自定义 UserType 类。具体案例是 HL7v3 临床文档(我在健康 IT 部门工作)。它是一个可变对象,并且大多数有关 Hibernate UserType 接口的文档似乎都以不可变类型为中心。我想更好地了解如何以及何时使用接口方法,特别是:
assemble - 为什么有两个参数(一个可序列化,一个对象)?该方法的用例是什么?
反汇编 - 我应该实现此方法来返回可序列化的形式(例如字符串表示形式)吗?该方法何时以及如何被调用?
equals - 这是为了更新吗?读?争论?脏读?大多数情况下简单地返回 false 会产生什么后果?
替换 - 我真的不明白三个对象参数来自哪里,何时调用此方法,以及 Hibernate 期望返回什么,或者如何使用该返回值。
任何指示将不胜感激。我已经搜索并阅读了有关该主题的所有内容,但没有找到太多解释这些方法如何用于可变对象的文档。
I am creating a custom UserType class in Hibernate. The specific case is for an HL7v3 clinical document (I work in health IT). It is a mutable object and most of the documentation around the Hibernate UserType interface seems to center around immutable types. I want a better understanding of how and when the interface methods are used, specifically:
assemble - why two parameters (one Serializable, one Object)? What is the use case for this method?
disassemble - should I just implement this method to return a serializable form (e.g. String representation)? When and how is this method invoked?
equals - is this for update? read? contention? dirty reads? What are the consequences of simply returning false in most cases?
replace - I really don't understand where the three Object parameters come from, when this method is invoked, and what Hibernate expects to return, or how that return value is used.
Any pointers would be appreciated. I've searched and read all I can find on the subject, but have not found much documentation at all explaining how these methods are used for mutable objects.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论