I'm having a problem with formula. My code worked fine with Hibernate 2
but is broken with Hibernate 3. I don't understand why.
I'm using mysql with the spatial functionnalities.
I'm no longer able to load a geometry column.
My mapping is the following :
Code:
<property name="area" column="area" formula="AsText(area)" type="string" />
and I have a setter setArea(String area) which parses the string.
Unfortunately some of the strings which are loaded are corrupted.
Here is a trace I got :
Code:
[junit] Caused by: org.hibernate.PropertyAccessException: exception setting
property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false
for more info) setter of hep.glast.gds.data.SelectionParameters.setArea
[junit] at org.hibernate.tuple.PojoTuplizer.setPropertyValuesWithOptimi
zer(PojoTuplizer.java:203)
[junit] at org.hibernate.tuple.PojoTuplizer.setPropertyValues(PojoTupli
zer.java:173)
[junit] at org.hibernate.persister.entity.BasicEntityPersister.setPrope
rtyValues(BasicEntityPersister.java:2900)
[junit] at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL
oad.java:113)
[junit] at org.hibernate.loader.Loader.initializeEntitiesAndCollections
(Loader.java:510)
[junit] at org.hibernate.loader.Loader.doQuery(Loader.java:419)
[junit] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle
ctions(Loader.java:210)
[junit] at org.hibernate.loader.Loader.doList(Loader.java:1562)
[junit] at org.hibernate.loader.Loader.list(Loader.java:1545)
[junit] at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:3
75)
[junit] at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslat
orImpl.java:271)
[junit] at org.hibernate.impl.SessionImpl.list(SessionImpl.java:840)
[junit] at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)