I am using Hyperjaxb to generate my JPA mappings. Then I use hibernate3-maven-plugin to generate the SQL Script of the database. My problem lies in the fact that I have a type that has a property defined like this:
<xsd:element name="priority" type="xsd:boolean"/>
The sql script defines the column like this
PRIORITY bit,
And the JPA entity defines it like this
/**
* Obtient la valeur de la propriété priority.
*
*/
@Basic
@Column(name = "PRIORITY")
public boolean isPriority() {
return priority;
}
/**
* Définit la valeur de la propriété priority.
*
*/
public void setPriority(boolean value) {
this.priority = value;
}
I am using MySql as a backend. The problem raises when my JPA/Hibernate entityManager tries to validate my JPA model against the database. Then I get this error
org.hibernate.HibernateException: Wrong column type in custom.sample_type for column PRIORITY. Found: bit, expected: boolean
How can I fix this error? Somewhere I read I could do something like this in java code
@Basic
@Column(name = "B", columnDefinition = "BIT", length = 1)
public boolean isB() {
return b;
}
But my JPA java code is autogenerated by Hyperjaxb, so how can I achieve something like that with Hyperjaxb?