View Javadoc

1   /*
2    * Created on 4 déc. 2003
3    * 
4    * Copyright salto-consulting.com
5    */
6   package salto.tool.sql.data;
7   
8   import java.sql.Connection;
9   
10  import salto.tool.sql.ConnectionInfo;
11  import salto.tool.sql.DatabaseInfo;
12  
13  /***
14   * @author eloiez@salto-consulting.com
15   */
16  public class ShemaInfo {
17  	public String catalog;
18  	public String name;
19  	public TableInfo[] tableInfos;
20  
21  	private ConnectionInfo connInfo;
22  	
23  	/***
24  	 * @return Returns the connInfo.
25  	 */
26  	public ConnectionInfo getConnInfo() {
27  		return connInfo;
28  	}
29  
30  	public Connection getConn() {
31  		return connInfo.getConn();
32  	}
33  		
34  	/***
35  	 * @param connection
36  	 * @param info
37  	 */
38  	public ShemaInfo(ConnectionInfo connInfo) {
39  		this.connInfo = connInfo;
40  	}
41  	public TableInfo[] getTableInfos() {
42  		return getTableInfos(true);
43  	}
44  	/***
45  	 * @return Returns the tableInfos.
46  	 */
47  	public TableInfo[] getTableInfos(boolean find) {
48  		if (find && tableInfos == null) {
49  			tableInfos = DatabaseInfo.getTables(this);
50  		}
51  		return tableInfos;
52  	}
53  
54  	/***
55  	 * @param tableInfos The tableInfos to set.
56  	 */
57  	public void setTableInfos(TableInfo[] tableInfos) {
58  		this.tableInfos = tableInfos;
59  	}
60  
61  
62  	/***
63  	 * @return Returns the catalog.
64  	 */
65  	public String getCatalog() {
66  		return catalog;
67  	}
68  
69  	/***
70  	 * @param catalog The catalog to set.
71  	 */
72  	public void setCatalog(String catalog) {
73  		this.catalog = catalog;
74  	}
75  
76  	/***
77  	 * @return Returns the name.
78  	 */
79  	public String getName() {
80  		return name;
81  	}
82  
83  	/***
84  	 * @param name The name to set.
85  	 */
86  	public void setName(String name) {
87  		this.name = name;
88  	}
89  
90  }