SingularAttribute#getBindableJavaType returns the incorrect type for java.sql.Date

Description

org.hibernate.jpa.test.metamodel.EmbeddedTypeTest reproduces this issue.

#testSingularAttributeAccessByName reproduces the issue for a java.sql.Date attribute.

#testVersionAttributeMetadata reproduces the issue for a primitive int attribute.

Javadoc for SingularAttribute#getBindableJavaType says:

"Return the Java type of the represented object. If the bindable type of the object is PLURAL_ATTRIBUTE, the Java element type is returned. If the bindable type is SINGULAR_ATTRIBUTE or ENTITY_TYPE, the Java type of the represented entity or attribute is returned."

In #testSingularAttributeAccessByName, since ShelfLife#soldDate is declared as java.sql.Date, soldDate_.getBindableJavaType() should return java.sql.Date.class (not java.util.Date.class, which is causing the test to fail).

There appears to be a problem with primitive attributes as well, reproduced by #testVersionAttributeMetadata.

Environment

None

Assignee

Unassigned

Reporter

Gail Badner