Say folks - based on a kindly suggestion to look at creating a
UserTypes, I've read the javadocs and started to look at the existing
YesNoType code to see how to do this. Seems fairly easy.

One thing that's odd, when I tried type="boolean" the strings written to
the HSQL DB are "TRUE" or "FALSE" - but after looking at the
BooleanType.java code, it would seem that I should be seeing 1 or 0.

public class BooleanType extends PrimitiveType implements
DiscriminatorType {     
        private static final String TRUE = "1";
        private static final String FALSE = "0";
public String objectToSQLString(Object value) throws Exception {
        return ( ( (Boolean) value ).booleanValue() ) ? TRUE : FALSE;
        }

Am I missing something stupid and simple?
Thanks,
Tim

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Tim Colson
> Sent: Monday, August 11, 2003 3:12 PM
> To: [EMAIL PROTECTED]
> Subject: [Hibernate] custom boolean mapping?
> 
> 
> Say folks -
>   I just found out that type="boolean" or type="true_false" will put
> "TRUE" or "FALSE" into the DB and type="yes_no" will put "Y" or "N". 
> 
>   Is there a way to customize so that integer 1 or 0 is 
> placed in the DB
> instead? 
> 
> Thanks,
> Tim
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet
> _072303_01/01
> _______________________________________________
> hibernate-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/hibernate-devel
> 



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to