Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » long & BigDecimal mappings in entities from tables
long & BigDecimal mappings in entities from tables [message #722814] Tue, 06 September 2011 15:14 Go to next message
Steve Maring is currently offline Steve Maring
Messages: 10
Registered: September 2010
Junior Member
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 #722815 is a reply to message #722814] Tue, 06 September 2011 15:19 Go to previous messageGo to next message
Steve Maring is currently offline Steve Maring
Messages: 10
Registered: September 2010
Junior Member
Just a quick note: it would appear that those columns that don't show up for type manipulation are the ones that have Nullable set to "No" in the DB.
Re: long & BigDecimal mappings in entities from tables [message #722828 is a reply to message #722815] Tue, 06 September 2011 16:19 Go to previous messageGo to next message
Steve Maring is currently offline Steve Maring
Messages: 10
Registered: September 2010
Junior Member
I just tried it with Dali 3.0 in Indego. Same thing. "NOT NULL" columns do not show up in the "Customize Individual Entities" portion of the Generate Custom Entities. However, they do get generated with the default type mapping.
Re: long & BigDecimal mappings in entities from tables [message #723109 is a reply to message #722828] Wed, 07 September 2011 12:29 Go to previous message
Steve Maring is currently offline Steve Maring
Messages: 10
Registered: September 2010
Junior Member
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!
Previous Topic:Dali, Toplink (GlassFish) and DB2
Next Topic:Table Generation from Entities with Embeddable Inheritance
Goto Forum:
  


Current Time: Tue Jul 29 17:01:01 EDT 2014

Powered by FUDForum. Page generated in 0.02350 seconds