留言板

Query for User with Custom Query

Ramón García,修改在10 年前。

Query for User with Custom Query

New Member 帖子: 21 加入日期: 13-8-6 最近的帖子
Hi,

I have found a problem implementing a "special" functionality in my application. It is difficult to explain so I'll do my best.

I have a custom asset (created with Service Builder). Its name is Project and the users can use a custom portlet to manage and list this entity.

Some of my queries are kind of special, so I have several custom queries implemented (and working fine).

Now. my problem arrives when I have to do something different to query for a project. Now I have to query for users ordered by the number of projects they have created.

I have to execute the next query and retreive the list to my JSP:


select userId, 
	  firstName, 
	  lastName, 
	  jobTitle,  
	 (select count(*) from projects_project pp where pp.userId = u.userId and status = ? and groupId = ?) as projectCount
from user_ u
order by projectCount desc


Any idea of how to do that?

Thx
thumbnail
Byran Zaugg,修改在10 年前。

RE: Query for User with Custom Query

Expert 帖子: 252 加入日期: 12-4-6 最近的帖子
This forum is for Alloy UI discussions. You'll be better served by asking your question in Liferay Portal > 3. Development
Ramón García,修改在10 年前。

RE: Query for User with Custom Query

New Member 帖子: 21 加入日期: 13-8-6 最近的帖子
Ups! Sorry.