-->
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.  [ 4 posts ] 
Author Message
 Post subject: Middlegen and Oracle NUMBER problem
PostPosted: Fri Jan 30, 2004 8:52 pm 
Beginner
Beginner

Joined: Wed Jan 28, 2004 3:42 pm
Posts: 36
Hi,

Given the following column:

FDOC_TOTAL_AMT NUMBER(19,2)

Middlegen generates the following:

<property
name="fdocTotalAmount"
type="java.math.BigDecimal"
column="FDOC_TOTAL_AMT"
length="19"
/>

which results in ddl something like:

FDOC_TOTAL_AMT NUMBER(19, 19)

which is pretty useless :)

It should rather create something like this?

<property
name="fdocTotalAmount"
type="java.math.BigDecimal">
<column name="FDOC_TOTAL_AMT" sql-type="NUMERIC(19,2)"/>
</property>

Thanks,
Peter


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 01, 2004 8:14 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
True Middlegen does not generate the sql-type for the mapping documents. Maybe this should be an option (on a per-field basis).

A general question: How many users are using middlegen to generate mappings from which they use hbm2ddl to regenerate the schema?

Would it not be best to use the vendors tools to get the schema output. I can see a use for this if your changing database vendors or supporting multiple platforms. In that case you are (possibly) not working bottom up thus hand editing of the mapping documents is acceptable. How many people would be using one database vendors schema as the master then generating the schema for the other supported platforms? Interesting - I support multiple platforms in a current project myself but I am working from XDoclet as the master.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2004 7:14 am 
Beginner
Beginner

Joined: Thu Dec 11, 2003 9:54 am
Posts: 25
Hi David,

One more problem with XDoclet:

it doesn't export relations between a tables, like one-to-many, many-to-one... (I talk about hbm2ddl Ant task).

Is the a solution ?

--awt

david wrote:
True Middlegen does not generate the sql-type for the mapping documents. Maybe this should be an option (on a per-field basis).

A general question: How many users are using middlegen to generate mappings from which they use hbm2ddl to regenerate the schema?

Would it not be best to use the vendors tools to get the schema output. I can see a use for this if your changing database vendors or supporting multiple platforms. In that case you are (possibly) not working bottom up thus hand editing of the mapping documents is acceptable. How many people would be using one database vendors schema as the master then generating the schema for the other supported platforms? Interesting - I support multiple platforms in a current project myself but I am working from XDoclet as the master.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2004 8:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
You most certainly can define relationships using XDoclet which will generate the appropriate HBM mapping documents. This can then be used to generate the schema. In some cases you need to include additonal information in the HBMs (hence XDoclet) to provide preferences for DDL generation.

Maybe you should hand code a simple HBM example (parent - child) and get it to work first. See how the DDL is generated with various settings then you will know what need to be included at the XDoclet level.


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