dcsimg
CMP Custom finders and CMP remove
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Murtaza_Hussain
Posted On:   Monday, May 26, 2003 06:10 PM

Hi, I have two questions regarding CMP's: 1. Is it possible to achieve something like "Delete from myTable where id='abc'" using a CMP. My understanding is that I cannot use the remove method as the remove method deletes the row in the database using the primary key. 2. Is it possible to implement a finder that achieves "Select from myTable where id1='abc' and id2='def' and id3='ghi'" The number of arguments in where being variable (i.e 1 to 3). I tried using a finder with the following EjbQL "SELECT OBJECT(p) FROM myTable AS p WHERE p.id1=?1 and p.id2=?2 and p.id3=?3" and only supplied the search criteria that i wanted but it didnt work. I tried using the finder as follows and    More>>

Hi,
I have two questions regarding CMP's:

1. Is it possible to achieve something like "Delete from myTable where id='abc'" using a CMP.
My understanding is that I cannot use the remove method as the remove method deletes the row in the database using the primary key.

2. Is it possible to implement a finder that achieves "Select from myTable where id1='abc' and id2='def' and id3='ghi'" The number of arguments in where being variable (i.e 1 to 3).
I tried using a finder with the following EjbQL "SELECT OBJECT(p) FROM myTable AS p WHERE p.id1=?1 and p.id2=?2 and p.id3=?3" and only supplied the search criteria that i wanted but it didnt work.
I tried using the finder as follows and it didnt work:
find("abc" ,"" ,"") or
find("abc" ,"*", "")
Any suggestions on that??
Thanks

   <<Less

Re: CMP Custom finders and CMP remove

Posted By:   Anonymous  
Posted On:   Monday, May 26, 2003 10:40 PM

Hi Martaza,


Is it possible to achieve something like "Delete from myTable where id='abc'" using a CMP. My understanding is that I cannot use the remove method as the remove method deletes the row in the database using the primary key

'Delete from ...' does the same as the remove(), the record with the given id would be deleted. Then, why is it that you cannot use remove()? If you really want to delete the record from the db, you can use the remove method.
About | Sitemap | Contact