-->
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: Override boolean for non-null column in reverse engineering
PostPosted: Mon Feb 02, 2009 9:03 pm 
Newbie

Joined: Mon Feb 02, 2009 8:56 pm
Posts: 2
Hi,

I'm trying to override the default boolean primitive type that is used when reverse engineering a column that is of type "BOOLEAN NOT NULL". Even though the column can not be null, I want to use java.lang.Boolean for this field so that I can set the entity property to null temporarily or on objects that will never be persisted.

Using the hibernate.reveng.xml file does not seem to work, I have the following:
Code:
    <type-mapping>
        <sql-type jdbc-type="CHAR" hibernate-type="java.lang.String"/>
        <sql-type jdbc-type="INTEGER" hibernate-type="java.lang.Integer"/>
        <sql-type jdbc-type="BOOLEAN" not-null="false" hibernate-type="java.lang.Boolean"/>
        <sql-type jdbc-type="BOOLEAN" not-null="true" hibernate-type="java.lang.Boolean"/>
        <sql-type jdbc-type="NUMERIC" precision='1' hibernate-type="java.lang.Boolean"/>
    </type-mapping>

But I still get a type of boolean for those columns. Why doesn't this reverse engineering specification work? Is there any other way to do this?

Thanks!


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.