On Mon, May 10, 2010 at 6:34 AM, Raymond Feng <enjoyj...@gmail.com> wrote: > The get method of SDO uses XPath expressions. In our case, it should be: > company.get("department[number=123 and name='Jack']")
If the "and" clause happens to work with tuscany I'd be pleasantly surpised, but it's not part of the SDO 2.1/2.1.1 standard. If it were to work it would only work by virtue of accidental use of behaviour of the underlying emf implementation. The xpath syntax as described in the spec is as follows path ::= (scheme ':')? '/'? (step '/')* step scheme ::= [^:]+ step ::= '@'? property | property '[' index_from_1 ']' | property '.' index_from_0 | reference '[' attribute '=' value ']' | ".." property ::= NCName ;; may be simple or complex type attribute ::= NCName ;; must be simple type reference :: NCName ;; must be DataObject type index_from_0 ::= Digits index_from_1 ::= NotZero (Digits)? value ::= Literal | Number | Boolean Literal ::= '"' [^"]* '"' | "'" [^']* "'" Number ::= Digits ('.' Digits?)? | '.' Digits Boolean ::= true | false NotZero ::= [1-9] Digits ::= [0-9]+ ;; leading '/' begins at the root ;; ".." is the containing DataObject, using containment properties ;; Only the last step have an attribute as the property I'm afraid you would have to perform the access using one property=value clause and filter the result Kelvin. > ________________________________________________________________ > Raymond Feng > rf...@apache.org > Apache Tuscany PMC member and committer: tuscany.apache.org > Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com > Personal Web Site: www.enjoyjava.com > ________________________________________________________________ > On May 9, 2010, at 3:51 AM, fuguijie1985 wrote: > > Dear Sir or Madam: > I am a developer.I want some tuscany SDO help.In your DataObject > comment,I found this method:company.get("department[number=123]") . It's a > good method.But would you tell me if I need two or more properties like > [number=123 name='Jack'],etc,what could I do? Thank you very much! > > ________________________________ > 网易为中小企业免费提供企业邮箱(自主域名) >