Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Priyanka Dhingra
Service Builder
November 13, 2012 10:33 PM
Answer

Priyanka Dhingra

Rank: Liferay Master

Posts: 501

Join Date: December 19, 2011

Recent Posts

Hi
 1select
 2  count(track.id_terminal)
 3, company.name as myResult
 4from  track,detailsForTerminal, client,service,terminal, customer,customerGroup,Location,Item,company_plan,company
 5Where track.id_client = client.client_id
 6and
 7detailsForTerminal.id_terminal = track.id_terminal
 8and
 9detailsForTerminal.id_group = customerGroup.customerGroup_id
10and
11service.id_client = client.client_id
12and
13service.id_rm = terminal.terminal_id
14and
15track.id_customer = customer.customer_id
16and
17customerGroup.id_customer = customer.customer_id
18and terminal.serial = Location.rm_serial
19and
20Location.id_Item = Item.Item_id
21and
22Item. id_plan =  company_plan.companyplan_id
23and company_plan.id_company = company.company_id
24and customer.customer_id = 100
25group by company.name

How can i go about this kind of query using service builder??

thanks and regards
Priyanka Dhingra
Juan Gonzalez
RE: Service Builder
November 13, 2012 11:47 PM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1881

Join Date: October 28, 2008

Recent Posts

Did you try using custom sql? See link below:

http://www.liferay.com/community/wiki/-/wiki/Main/Custom+queries+in+Liferay
Subhash Pavuskar
RE: Service Builder
November 14, 2012 1:13 AM
Answer

Subhash Pavuskar

Rank: Regular Member

Posts: 234

Join Date: March 12, 2012

Recent Posts

Hope this 2 links may help you to solve your Custom Query !!

Link1

Link2
Priyanka Dhingra
RE: Service Builder
November 14, 2012 9:50 PM
Answer

Priyanka Dhingra

Rank: Liferay Master

Posts: 501

Join Date: December 19, 2011

Recent Posts

thanks for the link...

but I have multiple tables in from clause ...so what should be the finder class and interface to refer???

Better if i could find a solution using some hibernate logic, since I have many queries like that...may be some workaround like inner join or something can help...but I do not have much knowledge on db
Priyanka Dhingra
RE: Service Builder
November 16, 2012 7:06 AM
Answer

Priyanka Dhingra

Rank: Liferay Master

Posts: 501

Join Date: December 19, 2011

Recent Posts

Help!! emoticon