1 28 29 package com.caucho.amber.expr; 30 31 import com.caucho.amber.entity.Embeddable; 32 import com.caucho.amber.field.AmberField; 33 import com.caucho.amber.manager.AmberConnection; 34 import com.caucho.amber.query.FromItem; 35 import com.caucho.amber.query.QueryParser; 36 import com.caucho.amber.table.LinkColumns; 37 import com.caucho.amber.table.Table; 38 import com.caucho.amber.type.EmbeddableType; 39 import com.caucho.amber.type.Type; 40 import com.caucho.util.CharBuffer; 41 42 import java.lang.reflect.Method ; 43 import java.sql.ResultSet ; 44 import java.sql.SQLException ; 45 import java.util.ArrayList ; 46 import java.util.HashSet ; 47 import java.util.Iterator ; 48 import java.util.Map ; 49 50 53 public class LoadEmbeddedExpr extends LoadExpr { 54 55 LoadEmbeddedExpr(PathExpr expr) 56 { 57 super(expr); 58 } 59 60 63 public EmbeddableType getEmbeddableType() 64 { 65 return (EmbeddableType) getType(); 66 } 67 68 71 public AmberExpr bindSelect(QueryParser parser) 72 { 73 _fromItem = _expr.bindSubPath(parser); 74 75 if (_fromItem == null) 76 throw new NullPointerException (_expr.getClass().getName() + " " + _expr); 77 78 return this; 79 } 80 81 84 public Object getObject(AmberConnection aConn, ResultSet rs, int index) 85 throws SQLException 86 { 87 Embeddable embeddable = getEmbeddableType().createObject(); 88 89 embeddable.__caucho_load(aConn, rs, index); 90 91 return embeddable; 92 } 93 94 97 public Object getCacheObject(AmberConnection aConn, 98 ResultSet rs, 99 int index) 100 throws SQLException 101 { 102 104 return getObject(aConn, rs, index); 105 } 106 } 107 | Popular Tags |