-->
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.  [ 1 post ] 
Author Message
 Post subject: Custom type not being picked up?
PostPosted: Tue Nov 16, 2010 9:54 am 
Regular
Regular

Joined: Wed Oct 15, 2003 4:40 pm
Posts: 67
I'm on 3.6.0.Final and have a simple

Code:
public class CustomYesNoType extends YesNoType
{
   private static final long serialVersionUID = 1L;

   @Override
   public String getName()
   {
      return "customYesNo";
   }

   @Override
   public String objectToSQLString(Boolean value, Dialect dialect) throws Exception
   {
      return StringType.INSTANCE.objectToSQLString(value.booleanValue() ? "A" : "B", dialect);
   }

}


which I use on the entity like

Code:
@TypeDef(name="customYesNoType", typeClass=CustomYesNoType.class)


and

Code:
@Type(type="customYesNoType")
boolean theBoolean


but for some strange reason, the boolean is false, no matter if the field is A or B in the DB. Is the type not picked up or is there some error in the implementation?

Thanks in advance,
Nik


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

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.