SQL吗?既然三个字段两个都确定了,直接查就是了。

解决方案 »

  1.   

    如果你的parentid和cname这样已经知道了.知道了还需要吗?知道用where不就行了?
      

  2.   

    如果是
    Parent中one-to-many属性Childs,类型为List
    Child中many-to-one属性parentId,类型为Parentselect c 
    from Parent p, 
    Child c 
    where c.parentId = p 
    and p.id = 1 
    and c.cName = 'abc'
    where处也可以
    c.parentId.id = p.id还可以用join语句,不过我不熟,我喜欢传统sql的写法。
      

  3.   

    from Child child where child.parent.parentId = 1 and child.name = 'abc'