long & BigDecimal mappings in entities from tables [message #722814] |
Tue, 06 September 2011 15:14  |
Eclipse User |
|
|
|
I'm using Dali 2.3.4 on Helios.
When using the "generate entities from tables" wizard, I am getting some unusual behavior.
I have an Oracle 11g database table schema that, unfortunately, does not have any foreign key constraints explicitly defined. All of the identifying columns have been created as NUMBER(22,0). The primary key column always comes out as a long, as does any cardinality that I explicitly define. However, there are some NUMBER(22,0) columns that I would like to have remain Basic types. Those always get generated as BigDecimal, instead of long, which is kinda messing things up. I would not be so concerned if not for the fact that I'm not even presented with the option to modify those types in the wizard. The columns don't even show up, but the mappings do get generated!
Am I missing something here? Is there a way to globally define that I want all NUMBER(22,0) database types to map to a long?
-Steve Maring
|
|
|
|
|
Re: long & BigDecimal mappings in entities from tables [message #723109 is a reply to message #722828] |
Wed, 07 September 2011 12:29  |
Eclipse User |
|
|
|
I ended up going in a completely different direction. I used the hbm2java Ant tool, from within Maven, and configured the reveng.xml file to have:
<type-mapping>
<sql-type jdbc-type="DECIMAL" precision="22" scale="0" hibernate-type="long" />
</type-mapping>
Seems to work perfectly ... so ... never mind.
Maybe I'll play with my Dali (pun intended) again in the future!
|
|
|
Powered by
FUDForum. Page generated in 0.03738 seconds