-->
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: Middlegen-Hibernate Mapping for Oracle TypeMapping [Integer]
PostPosted: Thu Apr 07, 2005 12:15 am 
Newbie

Joined: Thu Apr 07, 2005 12:02 am
Posts: 1
Hibernate version: 2.0
Middlegen-Hibernate version: R-5
Name and version of the database you are using:Oracle 9i
The generated SQL (show_sql=true):True

Hi,.. I Just got some problem from XBM Generated by Middlegen,

In the oracle table description look like this :

SQL> desc systlogin;
Name Null? Type
----------------------------------------- -------- ---------------------------
SYSTLOGIN_PK NOT NULL NUMBER(38)
SYSTROLE_FK NUMBER(38)
CUSTOMER_FK NUMBER(38)
LOGINID NOT NULL VARCHAR2(10)
NAMA VARCHAR2(50)
ATASAN NUMBER(38)
PASSWORD VARCHAR2(20)
LANGUAGE VARCHAR2(2)

Look at this,..
SYSTLOGIN_PK NOT NULL NUMBER(38) <--- its was Integer in Oracle PL/SQL


The Question is : WHY everytime i try to generate XBM from this table its produce UNEXPECTED type of Data, Middelegen will produce XBM type data to BIGDECIMAL..In this case i want Middlegen to produce SYSTLOGIN_PK type data to INTEGER

Systlogin.xbm.xml similar look like this :

<class
name="com.latih.db.Systlogin"
table="SYSTLOGIN"
>

<id
name="systloginPk"
type="java.math.BigDecimal"
column="SYSTLOGIN_PK"
>
<generator class="native" />
</id>

Anyone can figure me out ? Thanks,..


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 07, 2005 9:13 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Middlegen is deciding that you need to use a BigDecimal to reliably store the (potentially large) integer value. You can tell it what type you want to use by selecting it in the GUI and you can supply your own custom type mapper so that defaults are how you expect them to be mapped.


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.