1 package com.teamkonzept.field.db; 2 3 import com.teamkonzept.db.*; 4 import java.sql.*; 5 6 public class TKContentNodeTableData extends TKDBTableData{ 7 public int content_id; 8 public int content_node_id; 9 public int left_nr; 10 public int right_nr; 11 public String name; 12 13 14 public TKContentNodeTableData () 15 { 16 } 17 18 public TKContentNodeTableData( int content_id, int content_node_id, int left_nr, int right_nr, String name ) 19 { 20 this.content_id = content_id; 21 this.content_node_id = content_node_id; 22 this.left_nr = left_nr; 23 this.right_nr = right_nr; 24 this.name = name; 25 } 26 27 public TKContentNodeTableData ( ResultSet r ) 28 throws SQLException 29 { 30 this.content_id = r.getInt("CONTENT_ID"); 31 this.content_node_id = r.getInt("CONTENT_NODE_ID"); 32 this.left_nr = r.getInt("LEFT_NR"); 33 this.right_nr = r.getInt("RIGHT_NR"); 34 this.name = r.getString("NAME"); 35 if (name.equals(QueryConstants.EMPTY_STRING_VALUE)) 36 { 37 name = ""; 38 } 39 } 40 41 public void updatePrimary (TKDBVectorData dbData) { 42 43 TKContentDBData cdata = (TKContentDBData) dbData; 44 content_id = cdata.content_id; 45 } 46 47 public TKDBTableData newFromResultSet( ResultSet r ) 48 throws SQLException 49 { 50 return new TKContentNodeTableData( r ); 51 } 52 53 public void insertIntoQuery(TKQuery query) 54 throws SQLException 55 { 56 query.setQueryParams("CONTENT_ID", new Integer (content_id)); 57 query.setQueryParams("CONTENT_NODE_ID", new Integer (content_node_id)); 58 query.setQueryParams("LEFT_NR", new Integer (left_nr)); 59 query.setQueryParams("RIGHT_NR", new Integer (right_nr)); 60 if (name == null || name.length() == 0) 61 { 62 name = QueryConstants.EMPTY_STRING_VALUE; 63 } 64 query.setQueryParams("NAME", name); 65 } 66 67 public String toString() 68 { 69 return "( CONTENT_ID="+String.valueOf( content_id ) 70 + ", CONTENT_NODE_ID="+String.valueOf( content_node_id ) 71 + ", LEFT_NR="+String.valueOf( left_nr ) 72 + ", RIGHT_NR="+String.valueOf( right_nr ) 73 + ", NAME="+name 74 + ")<BR>"; 75 } 76 } 77 | Popular Tags |