i have 2D double array attribute but as JPA doesn't work with array i have a @XmlJavaTypeAdapter(DoubleArrayAdapter.class) to store my array in a string for postgresql...
I am working with JDK 21 and Jakarta.
i use these maven plugin to generate Java classes & sql from xsd files.
org.hibernate.orm => hibernate-jpamodelgen 6.6.2.Final
org.patrodyne.jvnet => hisrc-hyperjaxb-maven-plugin 2.2.1
my XSD for the array attribute is :
<xsd:element name="speeds" type="xsd:string">
<xsd:annotation>
<xsd:appinfo>
<xjc:javaType name="double[][]" adapter="org.sailquest.model.adapter.DoubleArrayAdapter"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
There is no XJB file.
The Java code generated is :
@XmlElement(required = true, type = String.class)
@XmlJavaTypeAdapter(DoubleArrayAdapter.class)
@XmlSchemaType(name = "double")
protected double[][] speeds;
/**
* Obtient la valeur de la propriété speeds.
*
* @return
* possible object is
* {@link String }
*
*/
@Transient
public double[][] getSpeeds() {
return speeds;
}
/**
* Définit la valeur de la propriété speeds.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSpeeds(double[][] value) {
this.speeds = value;
}
@Transient
public boolean isSetSpeeds() {
return (this.speeds!= null);
}
The Java generation seems ok (the getter is transient ???) but there is an error message during generation and the column is not created during database sql generation.
The speeds column is not generated because there's an error during generation : [INFO] XJC> Xhyperjaxb-jpa: : Start Parameters NaiveInheritanceStrategy.: false MaxIdentifierLength......: null PersistenceUnitName......: null PersistenceXml...........: null Result...................: annotations RoundtripTestClassName...: null ValidateXml.: null (ignored) TargetDir................: null Verbose..................: true Debug....................: false [ERROR] XJC> Xhyperjaxb-jpa: TODO [ ...ataModel/Sail.xsd{30,49} ], getAttributeMapping: class=Sail, field=speeds; could not be annotated. It will be made transient.
And the getter is transient...
Why i have this message?
Thanks for your help!
Guillaume