List Info

Thread: How do I embed constants in ResultMaps/ParamaterMaps?




How do I embed constants in ResultMaps/ParamaterMaps?
country flaguser name
United States
2008-03-20 11:07:16
Say I have a constant value that I want the result map to
populate the class
with, is there any way to do this? I tried the following but
none worked:

<argument argumentName="providerName"
column="" type="string"
nullValue="SiteMembership" />
<argument argumentName="providerName"
type="string"
nullValue="SiteMembership" />

See there is no column in my database, but I want to
populate the class
"providerName" with "SiteMembership"
string. Is this possible?
-- 
View this message in context: http://www.n
abble.com/How-do-I-embed-constants-in-ResultMaps-ParamaterMa
ps--tp16182239p16182239.html
Sent from the iBATIS - User - Cs mailing list archive at
Nabble.com.


Re: How do I embed constants in ResultMaps/ParamaterMaps?
country flaguser name
United States
2008-03-20 12:20:05
Thanks, that worked like a charm!

Jakub Scheibe wrote:
> 
> U can always try with sql
> 
> select field1, field2 ..., "SitemMembership"
as providerName, field5 from
> ...
> 
> On 20/03/2008, dCyphr <dCyphr88hotmail.com> wrote:
>>
>>
>> Say I have a constant value that I want the result
map to populate the
>> class
>> with, is there any way to do this? I tried the
following but none worked:
>>
>> <argument argumentName="providerName"
column="" type="string"
>> nullValue="SiteMembership" />
>> <argument argumentName="providerName"
type="string"
>> nullValue="SiteMembership" />
>>
>> See there is no column in my database, but I want
to populate the class
>> "providerName" with
"SiteMembership" string. Is this possible?
>>
>> --
>> View this message in context:
>> http://www.n
abble.com/How-do-I-embed-constants-in-ResultMaps-ParamaterMa
ps--tp16182239p16182239.html
>> Sent from the iBATIS - User - Cs mailing list
archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.n
abble.com/How-do-I-embed-constants-in-ResultMaps-ParamaterMa
ps--tp16182239p16184209.html
Sent from the iBATIS - User - Cs mailing list archive at
Nabble.com.


RE: How do I embed constants in ResultMaps/ParamaterMaps?
country flaguser name
United States
2008-03-20 14:11:34
I'd create a user function that returned
"SiteMembership" so you
wouldn't have to change all .xml files if you ever need to
change the
text of that 


Select field1, field2, ...., GetProviderName() as
providerName, .....

CREATE FUNCTION dbo.GetProviderName()
	RETURNS nvarchar...
AS
BEGIN
	RETURN("SiteMembership")
END 


-----Original Message-----
From: dCyphr [mailto:dCyphr88hotmail.com] 
Sent: Thursday, March 20, 2008 11:20 AM
To: user-csibatis.apache.org
Subject: Re: How do I embed constants in
ResultMaps/ParamaterMaps?


Thanks, that worked like a charm!

Jakub Scheibe wrote:
> 
> U can always try with sql
> 
> select field1, field2 ..., "SitemMembership"
as providerName, field5
from
> ...
> 
> On 20/03/2008, dCyphr <dCyphr88hotmail.com> wrote:
>>
>>
>> Say I have a constant value that I want the result
map to populate
the
>> class
>> with, is there any way to do this? I tried the
following but none
worked:
>>
>> <argument argumentName="providerName"
column="" type="string"
>> nullValue="SiteMembership" />
>> <argument argumentName="providerName"
type="string"
>> nullValue="SiteMembership" />
>>
>> See there is no column in my database, but I want
to populate the
class
>> "providerName" with
"SiteMembership" string. Is this possible?
>>
>> --
>> View this message in context:
>>
http://www.nabble.com/How-do-I-embed-con
stants-in-ResultMaps-ParamaterMa
ps--tp16182239p16182239.html
>> Sent from the iBATIS - User - Cs mailing list
archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context:
http://www.nabble.com/How-do-I-embed-con
stants-in-ResultMaps-ParamaterMa
ps--tp16182239p16184209.html
Sent from the iBATIS - User - Cs mailing list archive at
Nabble.com.


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )