1 28 29 package com.caucho.db.sql; 30 31 import com.caucho.db.table.Table; 32 import com.caucho.log.Log; 33 34 import java.util.ArrayList ; 35 import java.util.logging.Logger ; 36 37 40 class FromItem { 41 private static final Logger log = Log.open(FromItem.class); 42 43 private Table _table; 44 private String _name; 45 46 private FromItem _dependTable; 47 48 FromItem(Table table, String name) 49 { 50 _table = table; 51 _name = name; 52 } 53 54 57 public Table getTable() 58 { 59 return _table; 60 } 61 62 65 public String getName() 66 { 67 return _name; 68 } 69 70 73 void setDependTable(FromItem table) 74 { 75 _dependTable = table; 76 } 77 78 81 boolean isValid(ArrayList <FromItem> tables) 82 { 83 if (_dependTable == null) 84 return true; 85 else 86 return ! tables.contains(this) || tables.contains(_dependTable); 87 } 88 89 92 public String toString() 93 { 94 return "FromItem[" + getTable().getName() + " AS " + _name + "]"; 95 } 96 } 97 | Popular Tags |