Sql Map

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Sql Map

kiran vuppla
Hi,

  I would like if we can do the following check in the Query inside <select> statement. I am reading the property from property file instead of parameter map. Though I have the property(CONSTRAINT) in the property file, this is not getting added to the existing SQL statement. Can someone help me.

<isNotNull prepend="AND"  property="${CONSTRAINT}">
  ${CONSTRAINT}
</isNotNull>

Thanks,
Kiran

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sql Map

Clinton Begin
If it's in a property file, can you just do this at the build stage?  It will be faster to do so too.

Clinton

On Mon, May 17, 2010 at 2:42 PM, kiran vuppla <[hidden email]> wrote:
Hi,

  I would like if we can do the following check in the Query inside <select> statement. I am reading the property from property file instead of parameter map. Though I have the property(CONSTRAINT) in the property file, this is not getting added to the existing SQL statement. Can someone help me.

<isNotNull prepend="AND"  property="${CONSTRAINT}">
  ${CONSTRAINT}
</isNotNull>

Thanks,
Kiran


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sql Map

kiran vuppla
I do not want to have it at build stage as it is customer specific and we will provide the war file to the customer and the client must be able to add it and we need to pick it during runtime or server startup. Is there any other way?

Thanks,
Kiran


From: Clinton Begin <[hidden email]>
To: [hidden email]
Sent: Mon, May 17, 2010 6:17:39 PM
Subject: Re: Sql Map

If it's in a property file, can you just do this at the build stage?  It will be faster to do so too.

Clinton

On Mon, May 17, 2010 at 2:42 PM, kiran vuppla <[hidden email]> wrote:
Hi,

  I would like if we can do the following check in the Query inside <select> statement. I am reading the property from property file instead of parameter map. Though I have the property(CONSTRAINT) in the property file, this is not getting added to the existing SQL statement. Can someone help me.

<isNotNull prepend="AND"  property="${CONSTRAINT}">
  ${CONSTRAINT}
</isNotNull>

Thanks,
Kiran



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sql Map

Clinton Begin
You can read it in from the file and try to pass it in just like any other parameter.  It's hard to fully understand what you're trying to do here.

Clinton

On Tue, May 18, 2010 at 7:12 AM, kiran vuppla <[hidden email]> wrote:
I do not want to have it at build stage as it is customer specific and we will provide the war file to the customer and the client must be able to add it and we need to pick it during runtime or server startup. Is there any other way?

Thanks,
Kiran


From: Clinton Begin <[hidden email]>
To: [hidden email]
Sent: Mon, May 17, 2010 6:17:39 PM
Subject: Re: Sql Map

If it's in a property file, can you just do this at the build stage?  It will be faster to do so too.

Clinton

On Mon, May 17, 2010 at 2:42 PM, kiran vuppla <[hidden email]> wrote:
Hi,

  I would like if we can do the following check in the Query inside <select> statement. I am reading the property from property file instead of parameter map. Though I have the property(CONSTRAINT) in the property file, this is not getting added to the existing SQL statement. Can someone help me.

<isNotNull prepend="AND"  property="${CONSTRAINT}">
  ${CONSTRAINT}
</isNotNull>

Thanks,
Kiran




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sql Map

kiran vuppla
Thanks for the reply.  Below is more info:

x.properties
 CONSTRAINT=col1='20'

y-sql-map.xml
<select name="test" >
 select col1, col2, col3 from tbl1 where col2 = 100 
<isNotNull prepend="AND" property="${CONSTRAINT}"> ${CONSTRAINT}</isNotNull> // HERE CONSTRAINT is read from property file (x.properties) and do not want to pass as // parameter from code
</select>

Thanks,
Kiran


From: Clinton Begin <[hidden email]>
To: [hidden email]
Sent: Tue, May 18, 2010 9:53:25 AM
Subject: Re: Sql Map

You can read it in from the file and try to pass it in just like any other parameter.  It's hard to fully understand what you're trying to do here.

Clinton

On Tue, May 18, 2010 at 7:12 AM, kiran vuppla <[hidden email]> wrote:
I do not want to have it at build stage as it is customer specific and we will provide the war file to the customer and the client must be able to add it and we need to pick it during runtime or server startup. Is there any other way?

Thanks,
Kiran


From: Clinton Begin <[hidden email]>
To: [hidden email]
Sent: Mon, May 17, 2010 6:17:39 PM
Subject: Re: Sql Map

If it's in a property file, can you just do this at the build stage?  It will be faster to do so too.

Clinton

On Mon, May 17, 2010 at 2:42 PM, kiran vuppla <[hidden email]> wrote:
Hi,

  I would like if we can do the following check in the Query inside <select> statement. I am reading the property from property file instead of parameter map. Though I have the property(CONSTRAINT) in the property file, this is not getting added to the existing SQL statement. Can someone help me.

<isNotNull prepend="AND"  property="${CONSTRAINT}">
  ${CONSTRAINT}
</isNotNull>

Thanks,
Kiran





Loading...