2016-06-02 6 views
0

openbravo를 쿼리하여 클라이언트를 전화 번호로 필터링하고 싶습니다. 두 테이블의 BusinessPartner와 BusinessPartnerLocation이 있습니다. BusinessPartnerLocation에는 BusinessPartner 객체의 id 인 phone 필드와 businessPartner 필드가 있습니다. 나는 이런 식으로 시도했다 http://server.opentix.es:3013/openbravo/org.openbravo.service.json.jsonrest/BusinessPartner?_where=e%20IN%20(%20SELECT%20DISTINCT%20bp%20FROM%20BusinessPartner%20RIGHT%20JOIN%20BusinessPartnerLocation%20ON%20BusinessPartner.id=BusinessPartnerLocation.businessPartner%20WHERE%20BusinessPartnerLocation.phone= '5555555')Openbravo URL 쿼리 빌딩 내측 조인, 오른쪽 조인

% 20s없이 또는 e없이() 여전히 작동하지 않았다. 이를위한 쿼리를 어떻게 만들 수 있습니까? 감사합니다.

답변

0
you should use below code that help to get both location geographical and businesspartner location without write hql. 

    bPartner = OBDao.getOBObjectListFromString(BusinessPartner.class, 
      strcBpartnerId); 

     List<Location> ls = bPartner.getBusinessPartnerLocationList(); 

        if (!ls.isEmpty()) { 
        org.openbravo.model.common.businesspartner.Location Location lcbpartner = ls.get(0); 
        org.openbravo.model.common.geography.Location lcgeo = lcbpartner.getLocationAddress(); 
        org.openbravo.model.common.businesspartner.Location lcbp = lcbpartner; 
        }