The code you suggest me is the same in the hibernate source code used for array test.
It works, of course, well, but only for User defined class as the B class of the example, with one-to-many relation.
In my code i need to persist a value-type array, suc ah double[], and i'm unable to mapping this double[] property.
I'm currently using this mapping:
<array name="standardParallel" cascade="all" table="PPARAMS_STPARALLELS">
<key column="STPARALLELS_ID"/>
<list-index column="STPARALLELS_INDEX" />
<element type="double" column="PPARAMS_STPARALLEL" />
</array>
and when i test this code i retrieve the exception:
org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of it.terranova.metadata.iso19115.referencesystem.MD_ProjectionParameters.setStandardParallel
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer(PojoEntityTuplizer.java:215)
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:185)
at ...
the setter is a simple:
void setStandardParallel(double[] _standardParallel)
{
this.standardParallel = _standardParallel;
}
|