开发者

unchecked generics usage warning on getAllClassMetadata() instance method of org.hibernate.SessionFactory

开发者 https://www.devze.com 2023-01-24 17:13 出处:网络
I just cant understand this. I\'m calling AnnotationConfiguration annotationConfiguration = new AnnotationConfiguration();

I just cant understand this. I'm calling

AnnotationConfiguration annotationConfiguration = new AnnotationConfiguration();
SessionFactory sessionFactory = annotationConfiguration.configure().buildSessionFactory();
Map<?, ?> allClassMetadata = sessionFactory.getAllClassMetadata();

Well, the only way I don't have warning is if I'm using wildcard ? But! if I look at definition of getAllClassMetadata() method in the SessionFactory interface or any of it's implementation the returning type is Map<String,ClassMetadata>. So, the problem is. When I write

Map<String,ClassMetadata> allClassMetadata = sessionFactory.getAllClassMetadata();

Eclipse tells me The expression of type Map 开发者_开发知识库needs unchecked conversion to conform to Map<String,ClassMetadata> I just don't get this. It's dumb. Please help.


This javadoc link says getAllClassMetadata() returns a Map

0

精彩评论

暂无评论...
验证码 换一张
取 消