TKContentInstanceDBData.java :  » Content-Management-System » webman » com » teamkonzept » webman » mainint » db » Java Open Source

Java Open Source » Content Management System » webman 
webman » com » teamkonzept » webman » mainint » db » TKContentInstanceDBData.java
package com.teamkonzept.webman.mainint.db;

import com.teamkonzept.db.*;
import java.sql.*;

public class TKContentInstanceDBData extends TKDBData {

  public int content_node_id;
  public int instance_id;
  
  public String instance_name;
  
  public TKContentInstanceDBData () {

    this.content_node_id = -1;
    this.instance_id = -1;

    this.instance_name = null;
  }
  
  public TKContentInstanceDBData(
    int content_node_id, String instance_name)
  {
    this.content_node_id = content_node_id;
    this.instance_id = -1;

    this.instance_name = instance_name;
  }
  
  public TKContentInstanceDBData(
    int content_node_id, int instance_id)
  {
    this.content_node_id = content_node_id;
    this.instance_id = instance_id;

    this.instance_name = null;
  }
  
  public void insertPrimaryIntoQuery (TKQuery query) throws SQLException {

    query.setQueryParams("INSTANCE_ID", new Integer(instance_id));
  }
  
  public void insertInitialIntoQuery (TKQuery query) throws SQLException {

    query.setQueryParams("CONTENT_NODE_ID", new Integer(content_node_id));
    query.setQueryParams("INST_NAME", instance_name);
  }
  
  public void insertIntoQuery (TKQuery query) throws SQLException {

    insertPrimaryIntoQuery (query);
    insertInitialIntoQuery (query);
  }

  public void fill (ResultSet r) throws SQLException {

    this.content_node_id = r.getInt("CONTENT_NODE_ID");
    this.instance_id = r.getInt("INSTANCE_ID");
    this.instance_name = r.getString("NAME");
  }
  
  public String toString() {

    return "( CONTENT := "
        + "(CONENT_NODE_ID = " + String.valueOf( content_node_id ) 
        + ", INSTANCE_ID = " + String.valueOf( instance_id ) 
        + ", INST_NAME = " + instance_name 
        + ")<BR>\n"
      + ")<BR>\n";
  }
  //{{DECLARE_CONTROLS
  //}}
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.