[Glorp-development] Re: SQL operator 'IN'
Status: Pre-Alpha
Brought to you by:
alan_knight,
anthonylander,
boris_popov,
cdegroot,
and 4 others
From: Alan K. <kn...@ac...> - 2002-01-04 02:18:22
|
OK. That, along with the proxy registration fix and a bunch of other things is now published in a 0.2.2 version. Note: This change breaks the tests, since it changes the way strings print as well. It's usually a good idea to re-run the tests when you make changes. At 09:40 AM 1/3/2002 +0200, Andrei N.Sobchuck wrote: > > You need to add in: as an operation, and you would need to make sure that > > the collection printed properly. See e,g. ConstantExpression and > > ParameterExpression printSQLOn:withParameters:. I think, since collections > > aren't valid in SQL anywhere else, that you could just implement > > glorpPrintSQLOn: for Collection. >I've added in: as operation and i've added such code: > >Collection>>glorpPrintSQLOn: aStream > > aStream nextPut: $(. > GlorpHelper > print: [ :each | | s | > s := (String new: 10) writeStream. > each glorpPrintSQLOn: s. > s contents] > on: aStream > for: self > separatedBy: ', '. > aStream nextPut: $). > >It work. >Please, add it to GLORP sources. > >-- >Andrei N.Sobchuck > > > > > > At 06:02 PM 1/2/2002 +0200, Andrei N.Sobchuck wrote: > > >How to add 'IN' to RelationExpression? > > >ForExample: > > >ReadQuery > > > returningManyOf: aClass > > > where: [ :e | > > > e anInstVar in: aCollection ]. > > >It will generate: > > >'... WHERE t1.x IN (2,10,50) ...' > > > > > > > > >-- > > >Andrei N.Sobchuck > > > > -- > > Alan Knight [|], Cincom Smalltalk Development > > kn...@ac... > > ak...@ci... > > http://www.cincom.com/scripts/smalltalk.exe/downloads/index.asp > > > > > > > > > > -- Alan Knight [|], Cincom Smalltalk Development kn...@ac... ak...@ci... http://www.cincom.com/scripts/smalltalk.exe/downloads/index.asp |