• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: String Qualifier for Number
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: String Qualifier for Number
      • From: Chuck Hill <email@hidden>
References: 
 >String Qualifier for Number (From: Carter Wojcik <email@hidden>)
 >Re: String Qualifier for Number (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: WWDC 08
  • Next by Date: Re: WWDC 08
  • Previous by thread: Re: String Qualifier for Number
  • Next by thread: Re: String Qualifier for Number
  • Index(es):
    • Date
    • Thread