-->
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.  [ 6 posts ] 
Author Message
 Post subject: reverse engineering - unsatisfying results
PostPosted: Wed Aug 17, 2005 11:02 am 
Beginner
Beginner

Joined: Mon May 02, 2005 6:17 pm
Posts: 41
hello
I'm using oracle 9.2.0 db , hibernate 3.0.5 and JDBC Thin Driver 9.2.0.
I used hibernate tools 3.0.0 alpha4a to reverse engineer db. the result whas not what i expected because almost all properties in the generated files are of type java.lang.Object.
Here is one generated entity with its mapping

Code:
public class Agent  implements java.io.Serializable {

    // Fields   

     private java.math.BigDecimal agentid;
     private Object agent;
     private Object description;
     private Object version;
     private Object publickey;
     private Character isdisabled;
     private Object created;
     private Object lastupdated;
}
<hibernate-mapping>
<!--
        Auto-generated mapping file from
        the hibernate.org cfg2hbm engine
-->
    <class name="Agent" table="AGENT" schema="NETDIALOG">
        <id name="agentid" type="big_decimal">
            <column name="AGENTID" precision="22" scale="0" />
            <generator class="assigned" />
        </id>
        <property name="agent" type="java.lang.Object">
            <column name="AGENT" not-null="true" unique="true" />
        </property>
        <property name="description" type="java.lang.Object">
            <column name="DESCRIPTION" />
        </property>
        <property name="version" type="java.lang.Object">
            <column name="VERSION" />
        </property>
        <property name="publickey" type="java.lang.Object">
            <column name="PUBLICKEY" />
        </property>
        <property name="isdisabled" type="character">
            <column name="ISDISABLED" length="1" />
        </property>
        <property name="created" type="java.lang.Object">
            <column name="CREATED" not-null="true" />
        </property>
        <property name="lastupdated" type="java.lang.Object">
            <column name="LASTUPDATED" />
        </property>
    </class>
</hibernate-mapping>

does anyone know a solution to this. thanks in advance

_________________
www.globalresearch.ca


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 12:30 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
what is the type of those fields ?

as a workaround use the reveng.xml support.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 4:16 pm 
Beginner
Beginner

Joined: Mon May 02, 2005 6:17 pm
Posts: 41
isDisabled field is BOOLEAN. Most other fields are NVARCHAR.
I tried overriding it in reveng.xml by mapping VARCHAR to java.lang.String but it was ignored. I'll be trying it some more when i get to work

_________________
www.globalresearch.ca


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 4:51 am 
Beginner
Beginner

Joined: Mon May 02, 2005 6:17 pm
Posts: 41
I have found out what the problem was. It has nothing to do with hibernate but with the script we were using. Sorry to trouble you

_________________
www.globalresearch.ca


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 4:52 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
anything the tool could have detected and thrown a warning/error about ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 7:20 am 
Beginner
Beginner

Joined: Mon May 02, 2005 6:17 pm
Posts: 41
The above described problem was in the script. Oracle didnt complain when it found NVARCHAR2 in the script it just made it OTHER in the db which was later maped to Object by tools.
I'm having some other problems though. I'll post them separately

_________________
www.globalresearch.ca


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