-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Formula no longer works in Hibernate 3
PostPosted: Tue May 17, 2005 8:19 pm 
Newbie

Joined: Mon May 16, 2005 1:12 pm
Posts: 4
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)


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 18, 2005 3:35 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
Quote:
column="area" formula="AsText(area)" type="string"


column + formula ?

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 18, 2005 2:02 pm 
Newbie

Joined: Mon May 16, 2005 1:12 pm
Posts: 4
Don't know if it helps but :

- I've removed the column attribute in <property> but it has not changed
anything. I've other definitions like this one for columns of type geometry
and formula + column seems to be OK.

- The statement causing the error is something like :
Code:
select sp from SelectionParameters sp where sp.owner.login = 'myself' order by sp.tag


I've omitted the "order by sp.tag" and the selection is now successful.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.