1 28 29 package com.caucho.amber.query; 30 31 import com.caucho.util.L10N; 32 33 import com.caucho.amber.type.EntityType; 34 35 38 public class TableIdExpr extends SchemaExpr { 39 private static final L10N L = new L10N(TableIdExpr.class); 40 41 private EntityType _type; 42 private String _name; 43 44 47 public TableIdExpr(EntityType type, String name) 48 { 49 _type = type; 50 _name = name; 51 } 52 53 56 public EntityType getEntityType() 57 { 58 return _type; 59 } 60 61 64 public String getTailName() 65 { 66 return _name; 67 } 68 69 72 public SchemaExpr createField(QueryParser parser, String name) 73 throws QueryParseException 74 { 75 throw parser.error(L.l("'{0}.{1}' is not allowed.", 76 _name, name)); 77 } 78 79 82 public FromItem addFromItem(QueryParser parser, String id) 83 throws QueryParseException 84 { 85 FromItem fromItem = parser.addFromItem(getEntityType().getTable(), id); 86 87 return fromItem; 88 } 89 } 90 | Popular Tags |