db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject Re: Proposal to support ESCAPE for Like-Criteria
Date Mon, 23 Feb 2004 21:06:58 GMT
hi all,

well i still don't know if using dbms-independent wildcards is a good thing :( 
but i'm not gonna change it until 1.0 is done.
afaik tino is using ms-access. maybe he can give me more info about how 
ms-access handles wildcards end escapes.

jakob

Jakob Braeuchi wrote:

> hi all,
> 
> due to so much pressure ;) i extended my implementation to support a 
> platform-dependent escape clause.
> the wildcard is not yet platform-dependent and may cause problems with 
> ms-access.
> 
> jakob
> 
> Jakob Braeuchi wrote:
> 
>> hi antonio,
>>
>> Antonio Gallardo wrote:
>>
>>> Larry Streepy dijo:
>>>
>>>> Certainly, the Platform interface would have to be extended, and I know
>>>> that's a pain.  But, it is the most "correct" solution.
>>>
>>>
>>>
>>>
>>> +1
>>>
>>> OJB also abstract the DB Engine. I guess, because currently we don't 
>>> need
>>> to care about the specific SQL syntax of the DB Engine we use. Also I
>>
>>
>>
>> that's only true as long as we stick to 'standard' features :(
>>
>>> believe we can "magically" switch from one database to another just by
>>> changing the <jdbc-connection-descriptor>. If OJB will allow some 
>>> specific
>>> DB Engine dependencies, then we will lose this nice feature of OJB.
>>
>>
>>
>> that's what it already does. you can use any dbms-specific function in 
>> a where clause and ojb will just pass it to the dbms.
>>
>> jakob
>>
>>>
>>> I think the best we can do is to extend the specific MS Acces classes to
>>> "convert" as requiered to follow the current OJB approach.
>>>
>>> Best Regards,
>>>
>>> Antonio Gallardo
>>>
>>>
>>>
>>>> Thanks,
>>>> Larry.
>>>>
>>>>
>>>>> -----Original Message-----
>>>>> From: Michael Mogley [mailto:mmogley@adelphia.net]
>>>>> Sent: Saturday, February 21, 2004 9:38 AM
>>>>> To: OJB Developers List
>>>>> Subject: Re: Proposal to support ESCAPE for Like-Criteria
>>>>>
>>>>> I was just thinking the same thing.  My understanding is the Platform
>>>>> interface was created to solve just this type of problem.  Though it
>>>>> doesn't
>>>>> currently have a method to get the escape character.
>>>>>
>>>>> Michael
>>>>>
>>>>> ----- Original Message -----
>>>>> From: "Larry Streepy" <larry@staffmix.com>
>>>>> To: "'OJB Developers List'" <ojb-dev@db.apache.org>
>>>>> Sent: Saturday, February 21, 2004 9:29 AM
>>>>> Subject: RE: Proposal to support ESCAPE for Like-Criteria
>>>>>
>>>>>
>>>>>
>>>>>> I would argue that specialized handling of the wildcard characters
>>>>>
>>>>>
>>>>>
>>>>> belongs
>>>>>
>>>>>> in the DB-specific classes.  One of the goals (at least in my 
>>>>>> mind) is
>>>>>
>>>>>
>>>>>
>>>>> that
>>>>>
>>>>>> OJB makes it fairly easy to move between database platforms without
>>>>>
>>>>>
>>>>>
>>>>> massive
>>>>>
>>>>>> changes to your application.  The proposal below breaks that paradigm
>>>>>
>>>>>
>>>>>
>>>>> by
>>>>>
>>>>>> requiring DB-specific handling for something as simple as wildcard
>>>>>
>>>>>
>>>>>
>>>>> handling.
>>>>>
>>>>>> I know I get no real vote, but take this as a plea to move this
>>>>>
>>>>>
>>>>>
>>>>> handling
>>>>>
>>>>>> into the DB-specific layers.
>>>>>>
>>>>>> Thanks.
>>>>>> Larry.
>>>>>>
>>>>>>
>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: Jakob Braeuchi [mailto:jbraeuchi@gmx.ch]
>>>>>>> Sent: Saturday, February 21, 2004 6:44 AM
>>>>>>> To: OJB Developers List; Nase.Paul@mayo.edu
>>>>>>> Subject: Proposal to support ESCAPE for Like-Criteria
>>>>>>>
>>>>>>> hi all,
>>>>>>>
>>>>>>> i had a long discussion with paul r. nase about like criteria
>>>>>
>>>>>
>>>>>
>>>>> containing
>>>>>
>>>>>>> escaped
>>>>>>> wildcards (example: first name like 'h%\%' escape '\' looks for
>>>>>
>>>>>
>>>>>
>>>>> firstname
>>>>>
>>>>>>> starting with 'h' and ending with '%'). for details see:
>>>>>>>
>>>>>>>  http://article.gmane.org/gmane.comp.jakarta.ojb.user/12505
>>>>>>>
>>>>>>> ojb currently does not properly support escaping of wildcards.
while
>>>>>>> experimenting with this feature i found that we have some dbms-
>>>>>
>>>>>
>>>>>
>>>>> dependent
>>>>>
>>>>>>> problems:
>>>>>>>
>>>>>>> 1.) escape character \ is the default in mysql so escape '\'
is not
>>>>>>> accepted.
>>>>>>> we'd need '\\'
>>>>>>> 2.) replacing wildcards *, ? by %, _ does not work for ms-access.
>>>>>>> 3.) escaping wildcards is different in ms-access
>>>>>>>
>>>>>>> so i propose to use a manual escaping in like-criteria without
>>>>>
>>>>>
>>>>>
>>>>> replacing
>>>>>
>>>>>
>>>>>>> wildcards. the user will have to provide the escape clause for
the
>>>>>
>>>>>
>>>>>
>>>>> like-
>>>>>
>>>>>>> criteria:
>>>>>>>
>>>>>>> addLike(attribute, criteria, escapeClause);
>>>>>>> ie:
>>>>>>> addLike("firstname", "h%\\%", "escape '\\'");
>>>>>>>
>>>>>>> ms_access: addLike("firstname", "h*[*]");
>>>>>>>
>>>>>>> the escape clause will be appended to the like-clause when building
>>>>>
>>>>>
>>>>>
>>>>> the
>>>>>
>>>>>>> sql.
>>>>>>> i'll implement a dedicated LikeCriteria to support escaping.
>>>>>>>
>>>>>>> what do you think about this ?
>>>>>>>
>>>>>>> jakob
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------

>>>>>>>
>>>>>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>>>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message