Convert query to JPQL

Hello
i have this query used in my database. i want to convert to JPQL

select s.id, s.name, count(user_id) as "count"
    from profilegen_User_Skill_Link as l
    join profilegen_skill as s on l.skill_id = s.id
    join profilegen_skill_category as sc on s.skillcategory_id = sc.id
where sc.name = 'Programmiersprachen'
group by s.name, s.id.

And is there any possibilities control this where clause by combo Box

catagar

Something like this:

select u.skill.id, u.skill.name, count(u)
from ns$User u
where u.skill.category.name = 'Programmiersprachen'
group by u.skill.name, u.skill.id

Thank you so much… its working :slight_smile:

I create Lookupfield name combo


combo.addValueChangeListener(new ValueChangeListener() {
@Override
public void valueChanged(ValueChangeEvent e) {

String catName = ((SkillCategory) e.getValue()).getName();


I want to user variable catname instead of ‘Programmiersprachen’

where u.skill.category.name =’ $categaory.valuechange.catname ’

Please format your source code properly…

when I select item from lookupfied that items come to in the where clause.

this is not working

select u.skill,count(u.user.id)
from profilegen$UserSkillLink u
where u.skill.skillcategory.name = :component$combo.name
group by u.skill.id

combo

**Not working= :component$combo.name **
comb1
select u.skill,count(u.user.id)
from profilegen$UserSkillLink u
where u.skill.skillcategory.name = :component$combo.name
group by u.skill.id,u.skill.name

If you want to refresh the table on changing value in LookupField, add a ValueChangeListener to the field and invoke datasource.refresh() in it.

Thank you so much… now its working

working