Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 为什么是hibernate';不推荐使用s ClassMetadata.getIdentifier(对象,EntityMode)_Java_Hibernate_Metadata_Introspection - Fatal编程技术网

Java 为什么是hibernate';不推荐使用s ClassMetadata.getIdentifier(对象,EntityMode)

Java 为什么是hibernate';不推荐使用s ClassMetadata.getIdentifier(对象,EntityMode),java,hibernate,metadata,introspection,Java,Hibernate,Metadata,Introspection,刚刚升级到hibernate 3.6.0,发现此方法已被弃用 public Serializable getIdentifier(Object object, EntityMode entityMode) throws HibernateException; 它已经被这个“取代” public Serializable getIdentifier(Object entity, SessionImplementor session); 我不知道为什么会这样做,更重要的是,我不相信新方法是一个合

刚刚升级到hibernate 3.6.0,发现此方法已被弃用

public Serializable getIdentifier(Object object, EntityMode entityMode) throws HibernateException;
它已经被这个“取代”

public Serializable getIdentifier(Object entity, SessionImplementor session);
我不知道为什么会这样做,更重要的是,我不相信新方法是一个合适的替代品

我有一段代码,通过使用这个API从XML(属性->属性等)和其他一些细节创建hibernate对象,从而绑定hibernate对象/属性

我一直认为ClassMetadata是用于此目的的公共API。我知道SessionImplementor是一个内部API,不用于应用程序代码

假设我在上述两个断言中是正确的,那么公共API需要私有API作为参数似乎是错误的

有人知道为什么要这样做,以及我将来应该如何进行编程式hibernate对象访问吗


(有趣的是,获取/设置属性值的方法仍然使用EntityMode。)

我问自己同样的问题。我不知道为什么会这样做,但现在我们需要一些脏铸件来使用公共API。这毫无意义。

我问自己同样的问题。我不知道为什么会这样做,但现在我们需要一些脏铸件来使用公共API。这毫无意义