留言板

What is the simplest way to delete some rows from Service Builder table?

thumbnail
Kravchenko Dmitry,修改在12 年前。

What is the simplest way to delete some rows from Service Builder table?

Regular Member 帖子: 139 加入日期: 10-10-4 最近的帖子
I want to delete some rows (by wildcard criterium) from my custom service builder's table. What is the simplest correct way to do this? Describe some finder? Issue custom SQL? Something else?
Jim Dunlop,修改在12 年前。

RE: What is the simplest way to delete some rows from Service Builder table

New Member 帖子: 18 加入日期: 10-11-25 最近的帖子
Kravchenko Dmitry:
I want to delete some rows (by wildcard criterium) from my custom service builder's table. What is the simplest correct way to do this? Describe some finder? Issue custom SQL? Something else?


Hi,
Finders created by Service Builder don't provide the possibility to use wildcards. So, you will rather need to use the custom SQL and implement the finder class by yourself.

Edit.
Oh, wait. I've just red that Service Builder's finders can compare using LIKE comparator. So it seems like it is possible to construct a finder you need to delete rows.
thumbnail
Nagendra Kumar Busam,修改在12 年前。

RE: What is the simplest way to delete some rows from Service Builder table

Liferay Master 帖子: 678 加入日期: 09-7-7 最近的帖子
Hi Dmitry,

You need to invoke some thing like this, i never tried this - please do let us know about status whether it is working or not
<finder name="Name" return-type="Collection">
	<finder-column name="Name" comparator="LIKE" />
</finder>


The attribute comparator takes in the values =, !=, <, <=, >, >=, or LIKE and is
used to compare this column.


Regards,
- Nagendra Kumar
thumbnail
Sagar A Vyas,修改在12 年前。

RE: What is the simplest way to delete some rows from Service Builder table

Liferay Master 帖子: 679 加入日期: 09-4-17 最近的帖子
Hi Dmitry,

Agree with Nagendra,


<finder name="Name" return-type="Collection">
    <finder-column name="StudentName" comparator="LIKE" />
</finder>


Above method would be like findByName(String sutdentName) if you pass any Student Name will return list of Object whose name like StudentName.

Something like as below

SELECT * FROM entityName WHERE StudentName LIKE 'givenValue%'


Thanks,
Sagar Vyas