1 package de.webman.acl.db; 2 3 import java.sql.ResultSet ; 4 import java.sql.SQLException ; 5 import com.teamkonzept.db.TKQuery; 6 import com.teamkonzept.lib.TKVector; 7 import de.webman.acl.Task; 8 9 18 public class TaskDBData 19 extends ObjectDBData 20 { 21 22 24 27 private String name = null; 28 29 32 private Integer context = null; 33 34 35 37 44 public TaskDBData (Integer id, 45 String name, 46 Integer context) 47 { 48 super(id); 49 50 this.name = name; 51 this.context = context; 52 } 53 54 59 public TaskDBData (Task task) 60 { 61 super(task); 62 63 this.name = task.getName(); 64 this.context = task.getContextID(); 65 } 66 67 68 70 75 public final ObjectDBInterface getDBInterface () 76 { 77 return TaskDBInterface.getInstance(); 78 } 79 80 88 public void insertInitialIntoQuery (TKQuery query) 89 throws SQLException 90 { 91 super.insertInitialIntoQuery(query); 92 93 query.setQueryParams("NAME", this.name); 94 query.setQueryParams(ContextDBInterface.getInstance().getPrimaryKeyName(), this.context); 95 } 96 97 106 public void fill (ResultSet result) 107 throws SQLException 108 { 109 this.name = result.getString("NAME"); 110 this.context = new Integer (result.getInt(ContextDBInterface.getInstance().getPrimaryKeyName())); 111 112 super.fill(result); 113 } 114 115 120 public final String getName () 121 { 122 return this.name; 123 } 124 125 130 public final Integer getContext () 131 { 132 return this.context; 133 } 134 135 } 136 | Popular Tags |