1 package com.teamkonzept.webman.mainint.db; 2 3 import com.teamkonzept.db.*; 4 import java.sql.*; 5 6 public class TKContentInstanceDBData extends TKDBData { 7 8 public int content_node_id; 9 public int instance_id; 10 11 public String instance_name; 12 13 public TKContentInstanceDBData () { 14 15 this.content_node_id = -1; 16 this.instance_id = -1; 17 18 this.instance_name = null; 19 } 20 21 public TKContentInstanceDBData( 22 int content_node_id, String instance_name) 23 { 24 this.content_node_id = content_node_id; 25 this.instance_id = -1; 26 27 this.instance_name = instance_name; 28 } 29 30 public TKContentInstanceDBData( 31 int content_node_id, int instance_id) 32 { 33 this.content_node_id = content_node_id; 34 this.instance_id = instance_id; 35 36 this.instance_name = null; 37 } 38 39 public void insertPrimaryIntoQuery (TKQuery query) throws SQLException { 40 41 query.setQueryParams("INSTANCE_ID", new Integer (instance_id)); 42 } 43 44 public void insertInitialIntoQuery (TKQuery query) throws SQLException { 45 46 query.setQueryParams("CONTENT_NODE_ID", new Integer (content_node_id)); 47 query.setQueryParams("INST_NAME", instance_name); 48 } 49 50 public void insertIntoQuery (TKQuery query) throws SQLException { 51 52 insertPrimaryIntoQuery (query); 53 insertInitialIntoQuery (query); 54 } 55 56 public void fill (ResultSet r) throws SQLException { 57 58 this.content_node_id = r.getInt("CONTENT_NODE_ID"); 59 this.instance_id = r.getInt("INSTANCE_ID"); 60 this.instance_name = r.getString("NAME"); 61 } 62 63 public String toString() { 64 65 return "( CONTENT := " 66 + "(CONENT_NODE_ID = " + String.valueOf( content_node_id ) 67 + ", INSTANCE_ID = " + String.valueOf( instance_id ) 68 + ", INST_NAME = " + instance_name 69 + ")<BR>\n" 70 + ")<BR>\n"; 71 } 72 } 75 | Popular Tags |