[vwnc] (Glorp) oracke boolean conversian

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] (Glorp) oracke boolean conversian

Maarten Mostert-2
Hi,
 
It has been some time since I fired up Oracle.  When I did I run into aBoolean not being apable of presenting itself as an integer (I rememeber Oracle wanting things to be this way).
 
When adding asNumber to True and False this worked fine.
 
Should this not be something included in Glorp ?
 
Regards,
 
@Maarten,
 
 
 
 
Unhandled exception: Message not understood: #asNumber
True(Object)>>doesNotUnderstand:
Glorp.OraclePlatform(Glorp.DatabasePlatform)>>convertToInteger:for:
Glorp.DelegatingDatabaseConverter>>convert:toDatabaseRepresentationAs:
Glorp.DirectMapping>>convertedDbValueOf:
Glorp.DirectMapping>>mapFromObject:toTarget:puttingRowsIn:
Glorp.DirectMapping>>mapFromObject:intoRowsIn:
optimized [] in Glorp.Descriptor>>createRowsFor:in:
Array(SequenceableCollection)>>do:
Glorp.Descriptor>>createRowsFor:in:
Glorp.GlorpSession>>createRowsFor:in:
optimized [] in Glorp.UnitOfWork>>createRowMapFor:
IdentitySet(Set)>>do:
Glorp.UnitOfWork>>createRowMapFor:
Glorp.UnitOfWork>>createRowsForPartialWrites
Glorp.UnitOfWork>>createRows
Glorp.UnitOfWork>>preCommit
optimized [] in Glorp.UnitOfWork>>commit
BlockClosure>>ifCurtailed:
Glorp.UnitOfWork>>commit
optimized [] in [] in Glorp.GlorpSession>>commitUnitOfWork
optimized [] in Glorp.DatabaseAccessor>>inTransactionDo:
BlockClosure>>ifCurtailed:
Glorp.VWDatabaseAccessor(Glorp.DatabaseAccessor)>>inTransactionDo:
Glorp.GlorpSession>>inTransactionDo:
optimized [] in Glorp.GlorpSession>>commitUnitOfWork
BlockClosure>>ifCurtailed:
Glorp.GlorpSession>>commitUnitOfWork
optimized [] in Glorp.GlorpSession>>inUnitOfWorkDo:
BlockClosure>>ifCurtailed:
Glorp.GlorpSession>>inUnitOfWorkDo:
MainProject>>createProject

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] (Glorp) oracke boolean conversian

Maarten Mostert-2
Hi,

Actually my problem seems to be wider then just the Oracle boolean.
For me still the most logical way would be that a boolean allways returns booleans no matter the platform so glorp
takes care of converting this in 0 1, yes no or true false.

Beside the Oracle thing, Acces now returns timestamps instead of dates ?? It didn't do that before.

Is their an inteligent way to install things like booleanToIntegerConverter as given in the DatabasePlatform class.

Regards,

@+Maarten,


> Message du 26/09/09 15:50
> De : "Maarten MOSTERT"
> A : "VWNC"
> Copie à :
> Objet : [vwnc] (Glorp) oracke boolean conversian
>
> Hi,
>
> It has been some time since I fired up Oracle. When I did I run into aBoolean not being apable of presenting
itself as an integer (I rememeber Oracle wanting things to be this way).

>
> When adding asNumber to True and False this worked fine.
>
> Should this not be something included in Glorp ?
>
> Regards,
>
> @Maarten,
>
>
>
>
> Unhandled exception: Message not understood: #asNumber
> True(Object)>>doesNotUnderstand:
> Glorp.OraclePlatform(Glorp.DatabasePlatform)>>convertToInteger:for:
> Glorp.DelegatingDatabaseConverter>>convert:toDatabaseRepresentationAs:
> Glorp.DirectMapping>>convertedDbValueOf:
> Glorp.DirectMapping>>mapFromObject:toTarget:puttingRowsIn:
> Glorp.DirectMapping>>mapFromObject:intoRowsIn:
> optimized [] in Glorp.Descriptor>>createRowsFor:in:
> Array(SequenceableCollection)>>do:
> Glorp.Descriptor>>createRowsFor:in:
> Glorp.GlorpSession>>createRowsFor:in:
> optimized [] in Glorp.UnitOfWork>>createRowMapFor:
> IdentitySet(Set)>>do:
> Glorp.UnitOfWork>>createRowMapFor:
> Glorp.UnitOfWork>>createRowsForPartialWrites
> Glorp.UnitOfWork>>createRows
> Glorp.UnitOfWork>>preCommit
> optimized [] in Glorp.UnitOfWork>>commit
> BlockClosure>>ifCurtailed:
> Glorp.UnitOfWork>>commit
> optimized [] in [] in Glorp.GlorpSession>>commitUnitOfWork
> optimized [] in Glorp.DatabaseAccessor>>inTransactionDo:
> BlockClosure>>ifCurtailed:
> Glorp.VWDatabaseAccessor(Glorp.DatabaseAccessor)>>inTransactionDo:
> Glorp.GlorpSession>>inTransactionDo:
> optimized [] in Glorp.GlorpSession>>commitUnitOfWork
> BlockClosure>>ifCurtailed:
> Glorp.GlorpSession>>commitUnitOfWork
> optimized [] in Glorp.GlorpSession>>inUnitOfWorkDo:
> BlockClosure>>ifCurtailed:
> Glorp.GlorpSession>>inUnitOfWorkDo:
> MainProject>>createProject
>
>
> [ (pas de nom de fichier) (0.1 Ko) ]



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] (Glorp) oracke boolean conversian

Holger Kleinsorgen-4
In reply to this post by Maarten Mostert-2
Maarten MOSTERT wrote:
> Hi,
>  
> It has been some time since I fired up Oracle.  When I did I run
> into aBoolean not being apable of presenting itself as an integer (I
> rememeber Oracle wanting things to be this way).
>  
> When adding asNumber to True and False this worked fine.
>  
> Should this not be something included in Glorp ?

I got this error, too, because I forgot to declare the type of the mapping:

(aDescriptor newMapping: DirectMapping)
    ....
    type: Boolean;
    ....


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] (Glorp) oracke boolean conversian

Alan Knight-2
Yes, if you've declare the attribute (really, it's better to do it in the classmodel than in the mapping, but either will do) and the field type is known, Glorp should attempt to convert between them automatically. If it's Boolean vs. Integer, it will do 0/1, if it's Boolean vs. string or char types it will do T/F

At 08:16 AM 2009-09-28, Holger Kleinsorgen wrote:
Maarten MOSTERT wrote:
> Hi,

> It has been some time since I fired up Oracle.  When I did I run
> into aBoolean not being apable of presenting itself as an integer (I
> rememeber Oracle wanting things to be this way).

> When adding asNumber to True and False this worked fine.

> Should this not be something included in Glorp ?

I got this error, too, because I forgot to declare the type of the mapping:

(aDescriptor newMapping: DirectMapping)
    ....
    type: Boolean;
    ....


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

--
Alan Knight [|], Engineering Manager, Cincom Smalltalk

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] (Glorp) oracke boolean conversian

Maarten Mostert-2
Thanks this did the job.


> Message du 28/09/09 16:14
> De : "Alan Knight"
> A : "Holger Kleinsorgen" , "VWNC"
> Copie à :
> Objet : Re: [vwnc] (Glorp) oracke boolean conversian
>
> Yes, if you've declare the attribute (really, it's better to do it in the classmodel than in the mapping, but
either will do) and the field type is known, Glorp should attempt to convert between them automatically. If
it's Boolean vs. Integer, it will do 0/1, if it's Boolean vs. string or char types it will do T/F

>
> At 08:16 AM 2009-09-28, Holger Kleinsorgen wrote:
> >Maarten MOSTERT wrote:
> >> Hi,
> >>
> >> It has been some time since I fired up Oracle. When I did I run
> >> into aBoolean not being apable of presenting itself as an integer (I
> >> rememeber Oracle wanting things to be this way).
> >>
> >> When adding asNumber to True and False this worked fine.
> >>
> >> Should this not be something included in Glorp ?
> >
> >I got this error, too, because I forgot to declare the type of the mapping:
> >
> >(aDescriptor newMapping: DirectMapping)
> > ....
> > type: Boolean;
> > ....
> >
> >
> >_______________________________________________
> >vwnc mailing list
> >[hidden email]
> >http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
> --
> Alan Knight [|], Engineering Manager, Cincom Smalltalk
> [hidden email]
> [hidden email]
> http://www.cincom.com/smalltalk
>
>
> [ (pas de nom de fichier) (0.1 Ko) ]



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc