I'm modeling an entity with hibernate. I'm using the JavaFX Property Pattern.
I'm using PROPERTY
access so Hibernate is looking at my methods for configuration.
My problem is the word "Issue" starts with "is" and so it seems that Hibernate thinks my property method is a getter for a boolean—something like isOpen()
.
It throws the following error when I try set up a SessionFactory
:
java.lang.ExceptionInInitializerError
Caused by: org.hibernate.MappingException: Could not determine type for: javafx.beans.property.ObjectProperty, at table: Remediations, for columns: [org.hibernate.mapping.Column(sueDetailProperty)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:456)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:423)
at org.hibernate.mapping.Property.isValid(Property.java:226)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:597)
at org.hibernate.mapping.RootClass.validate(RootClass.java:265)
at org.hibernate.boot.internal.MetadataImpl.validate(MetadataImpl.java:329)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:459)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:710)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:726)
at TestManyToManyWithExtraColumns.setUpSessionFactory(TestManyToManyWithExtraColumns.java:106)
at TestManyToManyWithExtraColumns.<clinit>(TestManyToManyWithExtraColumns.java:16)
Here's a watered down version to show the problem:
@Entity
@Access(AccessType.PROPERTY)
public class MyEntity{
...
@Column(name = "detail_id")
public IssueDetail getIssueDetail() {
return issueDetail.get();
}
public void setIssueDetail(IssueDetail issueDetail) {
this.issueDetail.set(issueDetail);
}
// throws error:
// "Could not determine type for: javafx.beans.property.ObjectProperty,
// at table: Remediations, for columns: [org.hibernate.mapping.Column(sueDetailProperty)]"
|
public ObjectProperty<IssueDetail> issueDetailProperty() {
return issueDetail.getOrCreateProperty();
}
}
How do I get Hibernate to stop thinking my method is a getter (besides changing the method name?)