留言板

Liferay Dxp Servicebuilder issue

thumbnail
krishna mohan mathakala,修改在6 年前。

Liferay Dxp Servicebuilder issue

Junior Member 帖子: 68 加入日期: 12-9-8 最近的帖子
Hi have created an Employee entity in my service.xml without any columns.When I build the service It is not generating the Employee.java in model layer. I created EmployeeFinderImpl to implement customsql and build service.Now a new class EmployeeFinderBaseImpl got generated as shown below.

public class EmployeeFinderBaseImpl extends BasePersistenceImpl< Employee > {
	public Employee FinderBaseImpl() {
		setModelClass(Employee.class);
	}
}


Now it is the compilation problem as Employee.java is not generated.
Can any one suggest the solution.
thumbnail
David H Nebinger,修改在6 年前。

RE: Liferay Dxp Servicebuilder issue (答复)

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
No-column entities are not backed by any model class because they are not seen as actual models. You can't build a finder on a no-column entity because there's nothing to base the retrieve on (no key) and no way to pass data back (because of no columns).

No column entities are meant to provide services only. For example, if I wanted to do some sort of custom method to return an existing SB-based (liferay) entity, I would use a no-column entity so SB would create the infrastructure for the service and then I just have to add the methods.

But in no way is a no column entity treated as some sort of "magical" or "wildcard" container.









Come meet me at Devcon 2017 or 2017 LSNA!
thumbnail
krishna mohan mathakala,修改在6 年前。

RE: Liferay Dxp Servicebuilder issue

Junior Member 帖子: 68 加入日期: 12-9-8 最近的帖子
Hi David Thanks for the reply.
I am able to build finder for a no column table in Liferay 6.2. And in older version of Liferay I do not see the above mentioned class getting generated.
thumbnail
David H Nebinger,修改在6 年前。

RE: Liferay Dxp Servicebuilder issue

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
If so, I'd call that a bug.

A no column entity was only supposed to be a service entry point.

If you need the Employee object, then add at least one column to it. Besides, an Employee object is quite common and likely to have some number of fields, so a no-column Employee entity doesn't really make a great deal of sense.









Come meet me at Devcon 2017 or 2017 LSNA!
thumbnail
krishna mohan mathakala,修改在6 年前。

RE: Liferay Dxp Servicebuilder issue

Junior Member 帖子: 68 加入日期: 12-9-8 最近的帖子
Hi David I just mentioned Employee as an example. My real entity name is completely different.
Thanks for your answer.