Re: String Qualifier for Number
Re: String Qualifier for Number
- Subject: Re: String Qualifier for Number
- From: shaun <email@hidden>
- Date: Fri, 14 Mar 2008 10:18:30 +1030
Chuck Hill wrote:
On Mar 13, 2008, at 10:47 AM, Carter Wojcik wrote:
Hi All -
My users want to have the ability to search on a
Number attribute, but use String qualifiers such as
Contains ('*value*'), Begins With ('value*'), Ends
With ('*value').
I have a table named part that contains a primaryKey
named part_id (Number and exposed) and a String called
descriptor.
Is there a way to create an EOQualifier that
replicates the SQL in the example below?
Example: Select all parts with a part_id that begins
with 3.
select * from part where to_char(part_id) like '3%';
Maybe...
Add a new attribute called partIDAsString
Set the column to part_id
Set the datatype as string
Mark it as read only
Set the read format to to_char(%P)
Then make a qualifier on partIDAsString.
Interesting approach. I hope it works.
The other day I was trying to do exactly the same thing as descibed by
Carter.
I used the Wonder RegExQualifier class as a base for my own EOQualifier
implementation and created the sql as required calling to_char(id)
it was all going well up until it actually had to do the fetch, thats
when JDBCColumn in the JDBCAdaptor classes got in the way and spoiled
the fun; it checks that the object type provided matches the models type
but '01%' is NAN so it throws an Exception. I'm not sure if there
is somethign i can do to get around this or not?
At that stage i figured i needed to try something else. Your idea above
is next in line.
Thanks.
- shaun
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden