1 28 29 package com.caucho.amber.expr; 30 31 import com.caucho.amber.query.FromItem; 32 import com.caucho.amber.query.QueryParseException; 33 import com.caucho.amber.query.QueryParser; 34 import com.caucho.util.L10N; 35 36 39 public class CollectionSchemaExpr extends SchemaExpr { 40 private static final L10N L = new L10N(CollectionSchemaExpr.class); 41 42 private PathExpr _expr; 43 private String _name; 44 45 48 public CollectionSchemaExpr(PathExpr expr, String name) 49 { 50 _expr = expr; 51 _name = name; 52 } 53 54 57 public String getTailName() 58 { 59 return _name; 60 } 61 62 65 public SchemaExpr createField(QueryParser parser, String name) 66 throws QueryParseException 67 { 68 throw parser.error(L.l("collections in FROM may not be sub-collected.")); 69 } 70 71 74 public FromItem addFromItem(QueryParser parser, String id) 75 throws QueryParseException 76 { 77 _expr = _expr.bindSelect(parser, id); 78 79 FromItem fromItem = _expr.bindSubPath(parser); 80 81 return fromItem; 82 } 83 } 84 | Popular Tags |