-->
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.  [ 2 posts ] 
Author Message
 Post subject: Mapping a legacy T/F varchar2 column using annotations
PostPosted: Tue Jun 26, 2007 12:35 pm 
Newbie

Joined: Thu Dec 09, 2004 4:26 am
Posts: 19
Location: Yorkshire, UK
Can anyone tell me if there is the equivalent of type="true_false" when mapping a property using hibernate annotations?

Using the hbm mapping I used to have:
Code:
   <property name="included" column="RUN_FLAG" type="true_false"/>


With annotations it now looks like:
Code:
   @Column(name = "RUN_FLAG")
   private boolean included;


I can't find any clues. Can someone please point me in the right direction?

Thanks,
Tim


Hibernate version:
3.1

Mapping documents:
Code:
...
   @Column(name = "RUN_FLAG")
   private boolean included;
...

Full stack trace of any exception that occurs:
Code:
ERROR - RequestCycle               - For input string: "F"
java.lang.NumberFormatException: For input string: "F"
   at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224)
   at java.lang.Double.valueOf(Double.java:447)
   at oracle.jdbc.driver.OracleStatement.getBooleanValue(OracleStatement.java:4500)
   at oracle.jdbc.driver.OracleResultSetImpl.getBoolean(OracleResultSetImpl.java:479)
   at oracle.jdbc.driver.OracleResultSet.getBoolean(OracleResultSet.java:1561)
   at org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.getBoolean(DelegatingResultSet.java:227)
   at org.hibernate.type.BooleanType.get(BooleanType.java:23)
   at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113)
   at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102)
   at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
   at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2046)
   at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1371)
   at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1299)
   at org.hibernate.loader.Loader.getRow(Loader.java:1197)
   at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:568)
   at org.hibernate.loader.Loader.doQuery(Loader.java:689)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
   at org.hibernate.loader.Loader.doList(Loader.java:2211)
   at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
   at org.hibernate.loader.Loader.list(Loader.java:2090)
   at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:95)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
   at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
   at org.springframework.orm.hibernate3.HibernateTemplate$5.doInHibernate(HibernateTemplate.java:533)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
   at org.springframework.orm.hibernate3.HibernateTemplate.loadAll(HibernateTemplate.java:529)

Name and version of the database you are using:
Oracle 10g


Top
 Profile  
 
 Post subject: Ooops
PostPosted: Tue Jun 26, 2007 1:32 pm 
Newbie

Joined: Thu Dec 09, 2004 4:26 am
Posts: 19
Location: Yorkshire, UK
Sorry, should have posted this in Non-core Annotations Forum.

See here for a copy in the right forum!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.