Pas*_*ent 10
这可以使用以下两者之一:
EntityPersister实现(您可以在使用自定义的Hibernate初始化期间注册特定实体Configuration)〜或〜Interceptor实现该Interceptor.instantiate()方法的自定义我认为Interceptor方法更容易.这是javadoc Interceptor.instantiate():
/**
* Instantiate the entity class. Return <tt>null</tt> to indicate that Hibernate should use
* the default constructor of the class. The identifier property of the returned instance
* should be initialized with the given identifier.
*
* @param entityName the name of the entity
* @param entityMode The type of entity instance to be returned.
* @param id the identifier of the new instance
* @return an instance of the class, or <tt>null</tt> to choose default behaviour
*/
public Object instantiate(String entityName, EntityMode entityMode, Serializable id) throws CallbackException;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5517 次 |
| 最近记录: |