Failure to determine data type in field access mode
---------------------------------------------------
Key: HHH-6579
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6579
Project: Hibernate Core
Issue Type: Bug
Components: annotations, metamodel
Affects Versions: 4.0.0.Beta5
Environment: Hibernate 4.0.0-Beta5 (org.hibernate.dialect.MySQLDialect)
Reporter: Markus Mårtensson
The below class, when passed through buildServiceRegistry() and buildMetadata()
will determine data type for "withGetter", but not for
"withoutGetter".
The placement of @Id sets the class into field access mode and correctly picks up
both fields, but fields without a getter needs an explicit @Type annotation.
The expected behavior is for both fields to have their types determined.
@Entity
public class Bugged {
@Id Long withoutGetter;
Long withGetter;
public Long getWithGetter() { return withGetter; }
}
Datatype detection log excerpt follows:
11:20:14.423 [main] DEBUG o.h.m.relational.AbstractSimpleValue - setting datatype for
column `Bugged`.`withoutGetter` : null
11:20:14.427 [main] DEBUG o.h.m.relational.AbstractSimpleValue - setting datatype for
column `Bugged`.`withGetter` : null
11:20:14.433 [main] DEBUG o.h.m.relational.AbstractSimpleValue - setting datatype for
column `Bugged`.`withGetter` :
org.hibernate.metamodel.relational.Datatype@76303ac7[code=-5, name=long,
javaClass=java.lang.Long]
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira