4

加载实体后是否发生任何事件?我的目标是将此实体添加到 Solr 或 Lucene 索引。EmptyInterceptor OnLoad 事件在对象初始化之前发生。我想在设置对象属性后处理一个事件。Hibernate拦截器或其他东西有可能吗?

4

1 回答 1

5

@PostLoad seems to do the job (see community documentation). If you annotate a method with this inside your entity, it should be triggered after the entity has been loaded.

于 2013-07-05T11:03:22.243 回答