Oracle Number field value converted to int

Posts   
 
    
JLLo avatar
JLLo
User
Posts: 18
Joined: 03-Nov-2008
# Posted on: 20-Mar-2009 18:18:02   

llblgen 2.6 Oracle 10g

The following are referenced in my project: Oracle.DataAccess.dll v.2.102.2.20 SD.LLBLGen.Pro.DQE.Oracle10g.NET20.dll v. 2.6.8.1009 SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll v. 2.6.8.1013


I have two fields (lat, lng). I've tried them as Numeric(15,10) as well as Float. In each case when I try to populate my entity object for this field the value is converted to an int thus truncating the value.

I checked the definition of my field object value that llbgen generates in the nameEntity.cs class:

/// <summary> The Lat property of the Entity CtipMap<br/><br/>
        /// </summary>
        /// <remarks>Mapped on  table field: "CTIP_MAP"."LAT"<br/>
        /// Table field type characteristics (type, precision, scale, length): Decimal, 38, 38, 22<br/>
        /// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
        public virtual System.Decimal Lat
        {
            get { return (System.Decimal)GetValue((int)CtipMapFieldIndex.Lat, true); }
            set { SetValue((int)CtipMapFieldIndex.Lat, value, true); }
        }

As you can see it converts the value to an int in with **SetValue **and return.

Any thoughts as to what I'm doing wrong? What other information can I provide?

Thanks, JL

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 20-Mar-2009 19:26:20   

JL, Is there any chance that you are using a TypeConverter?

David Elizondo | LLBLGen Support Team
JLLo avatar
JLLo
User
Posts: 18
Joined: 03-Nov-2008
# Posted on: 20-Mar-2009 20:04:39   

Hey David, I'm not doing anything fancy here so no Type Converter def's in my Designer Project (if I'm understanding the question). simple_smile

I have a co-worker here who's working on an Oracle/LLBLGen project but he's in a meeting. I'll check with him to see if he's writing anything to his db bigger than an int.

--James

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 21-Mar-2009 11:05:26   

The cast is for the enum, not for the value, the actual value is either left untouched (set, so it's decimal) or it's casted to decimal (get).

Frans Bouma | Lead developer LLBLGen Pro
JLLo avatar
JLLo
User
Posts: 18
Joined: 03-Nov-2008
# Posted on: 21-Mar-2009 14:23:51   

Problem Fixed!!! Mystery not solved.

I woke up this morning and ran my code. It worked the first time. No truncating decimal values.

Was this all a bad dream? Did I really toil for an afternoon trying to get this to work only to have it fix it self? I wish all my trouble would fix themselves.

Sorry for the trouble guys. Not sure what it was or how it got fixed. Must have been the LLBLGen Gnomes re-working my project while I slumbered.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 22-Mar-2009 18:50:34   

No worries. Good to know it's solved... by itself simple_smile

David Elizondo | LLBLGen Support Team