Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Priyanka Dhingra
Service Builder
13. November 2012 22:33
Antwort

Priyanka Dhingra

Rang: Liferay Master

Nachrichten: 501

Eintrittsdatum: 19. Dezember 2011

Neue Beiträge

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
13. November 2012 23:47
Antwort

Juan Gonzalez

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 1967

Eintrittsdatum: 28. Oktober 2008

Neue Beiträge

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
14. November 2012 01:13
Antwort

Subhash Pavuskar

Rang: Regular Member

Nachrichten: 234

Eintrittsdatum: 12. März 2012

Neue Beiträge

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

Link1

Link2
Priyanka Dhingra
RE: Service Builder
14. November 2012 21:50
Antwort

Priyanka Dhingra

Rang: Liferay Master

Nachrichten: 501

Eintrittsdatum: 19. Dezember 2011

Neue Beiträge

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
16. November 2012 07:06
Antwort

Priyanka Dhingra

Rang: Liferay Master

Nachrichten: 501

Eintrittsdatum: 19. Dezember 2011

Neue Beiträge

Help!! emoticon