# GridController.jpf Sample

This topic inludes the source code for the GridController.jpf Sample.

## Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_databinding/grid/

## Sample Source Code

`001 package tagSamples.netui_databinding.grid; 002 import com.bea.wlw.netui.pageflow.Forward; 003 004 import tagSamples.netui_databinding.grid.itemsrowsetcontrol.ItemsRowSetControl; 005 import java.util.Map; 006 import java.util.Iterator; 007 import javax.sql.RowSet; 008 import java.sql.SQLException; 009 import com.bea.wlw.netui.databinding.form.RowSetForm; 010 import com.bea.wlw.netui.pageflow.FormData; 011 012 import com.bea.wlw.netui.pageflow.PageFlowController; 013 import com.bea.wlw.netui.tags.databinding.SortFilterService; 014 import com.bea.wlw.netui.databinding.form.RowSetFormException; 015 import com.bea.wlw.netui.databinding.exception.RowIdentifierParseException; 016 import weblogic.jdbc.rowset.OptimisticConflictException; 017 import weblogic.jdbc.rowset.WLCachedRowSet; 018 019 /** 020 * PageFlow class generated from control ItemsRowSetControl 021 * @jpf:controller 022 * @jpf:view-properties view-properties:: 023 * <!-- This data is auto-generated. Hand-editing this section is not recommended. --> 024 * <view-properties> 025 * <pageflow-object id="pageflow:/tagSamples/netui_databinding/grid/GridController.jpf"/> 026 * <pageflow-object id="action:begin.do"> 027 * <property value="400" name="x"/> 028 * <property value="100" name="y"/> 029 * </pageflow-object> 030 * <pageflow-object id="action:insertItems.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm"> 031 * <property value="160" name="x"/> 032 * <property value="300" name="y"/> 033 * </pageflow-object> 034 * <pageflow-object id="action:submitInsert.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm"> 035 * <property value="280" name="x"/> 036 * <property value="400" name="y"/> 037 * </pageflow-object> 038 * <pageflow-object id="action:cancelInsert.do"> 039 * <property value="160" name="x"/> 040 * <property value="500" name="y"/> 041 * </pageflow-object> 042 * <pageflow-object id="action:detailsItems.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm"> 043 * <property value="400" name="x"/> 044 * <property value="300" name="y"/> 045 * </pageflow-object> 046 * <pageflow-object id="action:showGrid.do"> 047 * <property value="400" name="x"/> 048 * <property value="500" name="y"/> 049 * </pageflow-object> 050 * <pageflow-object id="action:updateItems.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm"> 051 * <property value="640" name="x"/> 052 * <property value="300" name="y"/> 053 * </pageflow-object> 054 * <pageflow-object id="action:submitUpdate.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm"> 055 * <property value="520" name="x"/> 056 * <property value="400" name="y"/> 057 * </pageflow-object> 058 * <pageflow-object id="action:cancelUpdate.do"> 059 * <property value="640" name="x"/> 060 * <property value="500" name="y"/> 061 * </pageflow-object> 062 * <pageflow-object id="action:deleteItems.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm"> 063 * <property value="280" name="x"/> 064 * <property value="500" name="y"/> 065 * </pageflow-object> 066 * <pageflow-object id="action:pageAction.do"> 067 * <property value="280" name="x"/> 068 * <property value="200" name="y"/> 069 * </pageflow-object> 070 * <pageflow-object id="action-call:@page:grid.jsp@#@action:detailsItems.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm@"> 071 * <property value="South_1" name="fromPort"/> 072 * <property value="North_1" name="toPort"/> 073 * <property value="400,400,400,400" name="elbowsX"/> 074 * <property value="244,250,250,256" name="elbowsY"/> 075 * </pageflow-object> 076 * <pageflow-object id="action-call:@page:grid.jsp@#@action:pageAction.do@"> 077 * <property value="364,340,340,316" name="elbowsX"/> 078 * <property value="181,181,181,181" name="elbowsY"/> 079 * <property value="West_0" name="fromPort"/> 080 * <property value="East_0" name="toPort"/> 081 * </pageflow-object> 082 * <pageflow-object id="action-call:@page:grid.jsp@#@action:insertItems.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm@"> 083 * <property value="South_1" name="fromPort"/> 084 * <property value="North_1" name="toPort"/> 085 * <property value="400,400,160,160" name="elbowsX"/> 086 * <property value="244,250,250,256" name="elbowsY"/> 087 * </pageflow-object> 088 * <pageflow-object id="action-call:@page:grid.jsp@#@action:updateItems.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm@"> 089 * <property value="South_1" name="fromPort"/> 090 * <property value="North_1" name="toPort"/> 091 * <property value="400,400,640,640" name="elbowsX"/> 092 * <property value="244,250,250,256" name="elbowsY"/> 093 * </pageflow-object> 094 * <pageflow-object id="page:grid.jsp"> 095 * <property value="400" name="x"/> 096 * <property value="200" name="y"/> 097 * </pageflow-object> 098 * <pageflow-object id="action-call:@page:insertItems.jsp@#@action:cancelInsert.do@"> 099 * <property value="South_1" name="fromPort"/> 100 * <property value="North_1" name="toPort"/> 101 * <property value="160,160,160,160" name="elbowsX"/> 102 * <property value="444,450,450,456" name="elbowsY"/> 103 * </pageflow-object> 104 * <pageflow-object id="action-call:@page:insertItems.jsp@#@action:submitInsert.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm@"> 105 * <property value="East_1" name="fromPort"/> 106 * <property value="West_1" name="toPort"/> 107 * <property value="196,220,220,244" name="elbowsX"/> 108 * <property value="392,392,392,392" name="elbowsY"/> 109 * </pageflow-object> 110 * <pageflow-object id="page:insertItems.jsp"> 111 * <property value="160" name="x"/> 112 * <property value="400" name="y"/> 113 * </pageflow-object> 114 * <pageflow-object id="action-call:@page:detailsItems.jsp@#@action:deleteItems.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm@"> 115 * <property value="South_0" name="fromPort"/> 116 * <property value="North_1" name="toPort"/> 117 * <property value="389,389,280,280" name="elbowsX"/> 118 * <property value="444,450,450,456" name="elbowsY"/> 119 * </pageflow-object> 120 * <pageflow-object id="action-call:@page:detailsItems.jsp@#@action:showGrid.do@"> 121 * <property value="South_1" name="fromPort"/> 122 * <property value="North_1" name="toPort"/> 123 * <property value="400,400,400,400" name="elbowsX"/> 124 * <property value="444,450,450,456" name="elbowsY"/> 125 * </pageflow-object> 126 * <pageflow-object id="action-call:@page:detailsItems.jsp@#@action:updateItems.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm@"> 127 * <property value="East_1" name="fromPort"/> 128 * <property value="West_1" name="toPort"/> 129 * <property value="436,520,520,604" name="elbowsX"/> 130 * <property value="392,392,292,292" name="elbowsY"/> 131 * </pageflow-object> 132 * <pageflow-object id="page:detailsItems.jsp"> 133 * <property value="400" name="x"/> 134 * <property value="400" name="y"/> 135 * </pageflow-object> 136 * <pageflow-object id="action-call:@page:updateItems.jsp@#@action:cancelUpdate.do@"> 137 * <property value="South_1" name="fromPort"/> 138 * <property value="North_1" name="toPort"/> 139 * <property value="640,640,640,640" name="elbowsX"/> 140 * <property value="444,450,450,456" name="elbowsY"/> 141 * </pageflow-object> 142 * <pageflow-object id="action-call:@page:updateItems.jsp@#@action:submitUpdate.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm@"> 143 * <property value="West_1" name="fromPort"/> 144 * <property value="East_1" name="toPort"/> 145 * <property value="604,580,580,556" name="elbowsX"/> 146 * <property value="392,392,392,392" name="elbowsY"/> 147 * </pageflow-object> 148 * <pageflow-object id="page:updateItems.jsp"> 149 * <property value="640" name="x"/> 150 * <property value="400" name="y"/> 151 * </pageflow-object> 152 * <pageflow-object id="page:/error.jsp"> 153 * <property value="160" name="x"/> 154 * <property value="200" name="y"/> 155 * </pageflow-object> 156 * <pageflow-object id="forward:path#grid#grid.jsp#@action:begin.do@"> 157 * <property value="South_0" name="fromPort"/> 158 * <property value="North_0" name="toPort"/> 159 * <property value="grid" name="label"/> 160 * <property value="389,389,389,389" name="elbowsX"/> 161 * <property value="144,150,150,156" name="elbowsY"/> 162 * </pageflow-object> 163 * <pageflow-object id="forward:path#insert#insertItems.jsp#@action:insertItems.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm@"> 164 * <property value="160,160,160,160" name="elbowsX"/> 165 * <property value="344,350,350,356" name="elbowsY"/> 166 * <property value="South_1" name="fromPort"/> 167 * <property value="North_1" name="toPort"/> 168 * <property value="insert" name="label"/> 169 * </pageflow-object> 170 * <pageflow-object id="forward:path#inserted#detailsItems.jsp#@action:submitInsert.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm@"> 171 * <property value="316,340,340,364" name="elbowsX"/> 172 * <property value="392,392,381,381" name="elbowsY"/> 173 * <property value="East_1" name="fromPort"/> 174 * <property value="West_0" name="toPort"/> 175 * <property value="inserted" name="label"/> 176 * </pageflow-object> 177 * <pageflow-object id="forward:path#canceled#begin.do#@action:cancelInsert.do@"> 178 * <property value="South_1" name="fromPort"/> 179 * <property value="West_1" name="toPort"/> 180 * <property value="canceled" name="label"/> 181 * <property value="160,80,80" name="elbowsX"/> 182 * <property value="580,580,92" name="elbowsY"/> 183 * </pageflow-object> 184 * <pageflow-object id="forward:path#view#detailsItems.jsp#@action:detailsItems.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm@"> 185 * <property value="400,400,400,400" name="elbowsX"/> 186 * <property value="344,350,350,356" name="elbowsY"/> 187 * <property value="South_1" name="fromPort"/> 188 * <property value="North_1" name="toPort"/> 189 * <property value="view" name="label"/> 190 * </pageflow-object> 191 * <pageflow-object id="forward:path#showGrid#begin.do#@action:showGrid.do@"> 192 * <property value="South_1" name="fromPort"/> 193 * <property value="West_1" name="toPort"/> 194 * <property value="showGrid" name="label"/> 195 * <property value="400,80,80" name="elbowsX"/> 196 * <property value="580,580,92" name="elbowsY"/> 197 * </pageflow-object> 198 * <pageflow-object id="forward:path#update#updateItems.jsp#@action:updateItems.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm@"> 199 * <property value="640,640,640,640" name="elbowsX"/> 200 * <property value="344,350,350,356" name="elbowsY"/> 201 * <property value="South_1" name="fromPort"/> 202 * <property value="North_1" name="toPort"/> 203 * <property value="update" name="label"/> 204 * </pageflow-object> 205 * <pageflow-object id="forward:path#updated#detailsItems.do#@action:submitUpdate.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm@"> 206 * <property value="North_1" name="fromPort"/> 207 * <property value="South_2" name="toPort"/> 208 * <property value="updated" name="label"/> 209 * <property value="520,520,411,411" name="elbowsX"/> 210 * <property value="356,350,350,344" name="elbowsY"/> 211 * </pageflow-object> 212 * <pageflow-object id="forward:path#canceled#begin.do#@action:cancelUpdate.do@"> 213 * <property value="South_1" name="fromPort"/> 214 * <property value="West_1" name="toPort"/> 215 * <property value="canceled" name="label"/> 216 * <property value="640,80,80" name="elbowsX"/> 217 * <property value="580,580,92" name="elbowsY"/> 218 * </pageflow-object> 219 * <pageflow-object id="forward:path#deleted#begin.do#@action:deleteItems.do#tagSamples.netui_databinding.grid.GridController.DatabaseForm@"> 220 * <property value="South_1" name="fromPort"/> 221 * <property value="West_1" name="toPort"/> 222 * <property value="deleted" name="label"/> 223 * <property value="280,80,80" name="elbowsX"/> 224 * <property value="580,580,92" name="elbowsY"/> 225 * </pageflow-object> 226 * <pageflow-object id="forward:path#page#grid.jsp#@action:pageAction.do@"> 227 * <property value="316,340,340,364" name="elbowsX"/> 228 * <property value="192,192,181,181" name="elbowsY"/> 229 * <property value="East_1" name="fromPort"/> 230 * <property value="West_0" name="toPort"/> 231 * <property value="page" name="label"/> 232 * </pageflow-object> 233 * <pageflow-object id="control:tagSamples.netui_databinding.grid.itemsrowsetcontrol.ItemsRowSetControl#myControl"> 234 * <property value="28" name="x"/> 235 * <property value="34" name="y"/> 236 * </pageflow-object> 237 * <pageflow-object id="formbeanprop:tagSamples.netui_databinding.grid.GridController.DatabaseForm#itemnumber#java.lang.Integer"/> 238 * <pageflow-object id="formbeanprop:tagSamples.netui_databinding.grid.GridController.DatabaseForm#itemname#java.lang.String"/> 239 * <pageflow-object id="formbeanprop:tagSamples.netui_databinding.grid.GridController.DatabaseForm#quantityavailable#java.lang.Integer"/> 240 * <pageflow-object id="formbeanprop:tagSamples.netui_databinding.grid.GridController.DatabaseForm#price#java.lang.Double"/> 241 * <pageflow-object id="formbean:tagSamples.netui_databinding.grid.GridController.DatabaseForm"/> 242 * </view-properties> 243 * :: 244 * @jpf:catch type="RowSetFormException" method="rowSetFormExceptionHandler" 245 * @jpf:catch type="java.sql.SQLException" method="sqlExceptionHandler" 246 * @jpf:catch type="java.lang.reflect.UndeclaredThrowableException" method="exceptionHandler" 247 * @jpf:catch type="RowIdentifierParseException" method="rowIdentifierParseExceptionHandler" 248 * @jpf:catch type="OptimisticConflictException" method="ocExceptionHandler" 249 */ 250 public class GridController extends PageFlowController 251 { 252 /** 253 * This is the control used to generate this pageflow 254 * @common:control 255 */ 256 private tagSamples.netui_databinding.grid.itemsrowsetcontrol.ItemsRowSetControl myControl; 257 258 259 // Uncomment this declaration to access Global.app. 260 // 261 // protected global.Global globalApp; 262 // 263 264 // For an example of page flow exception handling see the example "catch" and "exception-handler" 265 // annotations in {project}/WEB-INF/src/global/Global.app 266 267 private transient RowSet allRows; 268 private transient SortFilterService sortFilterService; 269 private transient String gridName = "gridControllerGridName"; 270 private transient RowSet lastRowFetched; 271 272 273 /** 274 * This method represents the point of entry into the page group 275 * @jpf:action 276 * @jpf:forward name="grid" path="grid.jsp" 277 * @jpf:catch method="exceptionHandler" type="java.lang.Exception" 278 */ 279 public Forward begin() 280 throws Exception 281 { 282 sortFilterService = SortFilterService.getInstance(getRequest()); 283 allRows = myControl.getAllItems(getSortFilterService().getDatabaseFilter(getGridName())); 284 return new Forward("grid"); 285 } 286 287 /** 288 * @jpf:action 289 * @jpf:forward name="insert" path="insertItems.jsp" 290 */ 291 public Forward insertItems(DatabaseForm form) 292 throws Exception 293 { 294 return new Forward("insert"); 295 } 296 297 /** 298 * @jpf:action 299 * @jpf:forward name="inserted" path="detailsItems.jsp" 300 */ 301 public Forward submitInsert(DatabaseForm aDatabaseForm) 302 throws Exception 303 { 304 getSortFilterService().reset(); 305 RowSet row = myControl.detailsItemsTemplate(); 306 307 308 aDatabaseForm.applyInsertValuesToRowSet(row); 309 RowSet var = myControl.insertItems(row); 310 aDatabaseForm.applyValuesToForm(var); 311 312 lastRowFetched = myControl.getInserted(); 313 DatabaseForm form = new DatabaseForm(); 314 form.applyValuesToForm(lastRowFetched); 315 316 getSortFilterService().addRowIdentifier(getGridName(),"itemnumber", form.getItemnumber() ); 317 318 return new Forward("inserted",form); 319 } 320 321 /** 322 * @jpf:action 323 * @jpf:forward name="canceled" path="begin.do" 324 */ 325 public Forward cancelInsert() 326 throws Exception 327 { 328 return new Forward("canceled"); 329 } 330 331 /** 332 * @jpf:action 333 * @jpf:forward name="view" path="detailsItems.jsp" 334 */ 335 public Forward detailsItems(DatabaseForm form) 336 throws Exception 337 { 338 lastRowFetched = getCurrentRow(); 339 form.applyValuesToForm(lastRowFetched); 340 341 return new Forward("view",form); 342 } 343 344 /** 345 * @jpf:action 346 * @jpf:forward name="showGrid" path="begin.do" 347 */ 348 public Forward showGrid() 349 throws Exception 350 { 351 return new Forward("showGrid"); 352 } 353 354 /** 355 * @jpf:action 356 * @jpf:forward name="update" path="updateItems.jsp" 357 */ 358 public Forward updateItems(DatabaseForm form) 359 throws Exception 360 { 361 lastRowFetched = getCurrentRow(); 362 form.applyValuesToForm(lastRowFetched); 363 364 return new Forward("update",form); 365 } 366 367 /** 368 * @jpf:action 369 * @jpf:forward name="updated" path="detailsItems.do" 370 */ 371 public Forward submitUpdate(DatabaseForm aDatabaseForm) 372 throws Exception 373 { 374 if(lastRowFetched == null) 375 { 376 System.err.println("There is no last row to manipulate."); 377 return new Forward("updated"); 378 } 379 getSortFilterService().reset(); 380 RowSet row = getLastRowFetched(); 381 382 aDatabaseForm.applyUpdateValuesToRowSet(row); 383 RowSet var = myControl.updateItems(row); 384 lastRowFetched = null; 385 386 return new Forward("updated"); 387 } 388 389 /** 390 * @jpf:action 391 * @jpf:forward name="canceled" path="begin.do" 392 */ 393 public Forward cancelUpdate() 394 throws Exception 395 { 396 return new Forward("canceled"); 397 } 398 399 /** 400 * @jpf:action 401 * @jpf:forward name="deleted" path="begin.do" 402 */ 403 public Forward deleteItems(DatabaseForm aDatabaseForm) 404 throws Exception 405 { 406 getSortFilterService().reset(); 407 408 RowSet row = getLastRowFetched(); 409 410 if( row == null ) 411 { 412 System.err.println("There is no last row to manipulate."); 413 return new Forward("deleted"); 414 } 415 row.absolute(1); 416 row.deleteRow(); 417 418 lastRowFetched = null; 419 420 myControl.deleteItems(row); 421 return new Forward("deleted"); 422 } 423 424 /** 425 * @jpf:action 426 * @jpf:forward name="page" path="grid.jsp" 427 */ 428 public Forward pageAction() 429 throws Exception 430 { 431 sortFilterService = SortFilterService.getInstance(getRequest()); 432 return new Forward("page"); 433 } 434 435 436 // 437 // Utility methods 438 // 439 440 441 private RowSet getCurrentRow() 442 { 443 String columnName = null; 444 try 445 { 446 columnName = "itemnumber"; 447 Integer pk0 = new Integer(SortFilterService.decodeUniqueIdentifier(getRequest(), getGridName(), columnName)); 448 lastRowFetched = myControl.detailsItems(pk0); 449 450 int rowCount = (( WLCachedRowSet ) lastRowFetched ).size(); 451 if(rowCount == 1) 452 return lastRowFetched; 453 else throw new IllegalStateException("The RowSet for the primary key is not valid"); 454 } 455 catch(Exception e) 456 { 457 RowIdentifierParseException ripe = 458 new RowIdentifierParseException 459 ("An exception occurred parsing the row identifier " + columnName + " for the grid named " + getGridName() + " caused by " + e.toString(), e); 460 throw ripe; 461 } 462 } 463 464 465 protected RowSet getLastRowFetched() 466 throws Exception 467 { 468 String columnName = null; 469 if(lastRowFetched != null) 470 { 471 columnName = "itemnumber"; 472 Integer pk0 = new Integer(SortFilterService.decodeUniqueIdentifier(getRequest(), getGridName(), columnName)); 473 474 lastRowFetched.absolute(1); 475 476 if( pk0.equals(lastRowFetched.getObject("itemnumber"))) 477 { 478 return lastRowFetched; 479 } 480 else 481 { 482 return getCurrentRow(); 483 } 484 } 485 else 486 { 487 return getCurrentRow(); 488 } 489 } 490 491 492 /** 493 * @jpf:exception-handler 494 * @jpf:forward name="errorPage" path="/error.jsp" 495 */ 496 protected Forward sqlExceptionHandler(SQLException ex,String actionName,String message,FormData form) 497 { 498 // log sql exception 499 String displayMessage = "An exception occurred in the action " + actionName; 500 getRequest().setAttribute("errorMessage", displayMessage); 501 return new Forward("errorPage"); 502 } 503 504 505 /** 506 * @jpf:exception-handler 507 * @jpf:forward name="errorPage" path="/error.jsp" 508 */ 509 protected Forward exceptionHandler(java.lang.Exception ex,String actionName,String message,FormData form) 510 { 511 // log general exception 512 String displayMessage = "An exception occurred in the action " + actionName; 513 getRequest().setAttribute("errorMessage", displayMessage); 514 return new Forward("errorPage"); 515 } 516 517 518 /** 519 * @jpf:exception-handler 520 * @jpf:forward name="errorPage" path="/error.jsp" 521 */ 522 protected Forward rowSetFormExceptionHandler(RowSetFormException ex,String actionName,String message,FormData form) 523 { 524 // log rowset exception 525 String displayMessage = "An exception occurred in the action " + actionName; 526 getRequest().setAttribute("errorMessage", displayMessage); 527 return new Forward("errorPage"); 528 } 529 530 531 /** 532 * @jpf:exception-handler 533 * @jpf:forward name="errorPage" path="/error.jsp" 534 */ 535 protected Forward rowIdentifierParseExceptionHandler(RowIdentifierParseException ex,String actionName,String message,FormData form) 536 { 537 // log rowset exception 538 String displayMessage = "An exception occurred in the action " + actionName; 539 getRequest().setAttribute("errorMessage", displayMessage); 540 return new Forward("errorPage"); 541 } 542 543 544 /** 545 * @jpf:exception-handler 546 * @jpf:forward name="errorPage" path="/error.jsp" 547 */ 548 protected Forward ocExceptionHandler(OptimisticConflictException ex,String actionName,String message,FormData form) 549 { 550 // log opimistic concurrency exception 551 String displayMessage = "A version conflict occurs when the underlying data in the database has changed after the WLCachedRowSet read the data into memory but before it can write back to the database. The exact circumstances that produce an OptimisticConflictException depend on the optimistic policy being used."; 552 getRequest().setAttribute("errorMessage", displayMessage); 553 return new Forward("errorPage"); 554 } 555 556 557 public SortFilterService getSortFilterService() 558 { 559 return sortFilterService; 560 } 561 562 563 protected void beforeAction() 564 { 565 if(getSortFilterService() == null) 566 { 567 sortFilterService = SortFilterService.getInstance(getRequest()); 568 } 569 570 sortFilterService.updateRowId(getRequest()); 571 } 572 573 574 public String getGridName() 575 { 576 return gridName; 577 } 578 579 580 581 public RowSet getAllRows() 582 { 583 return allRows; 584 } 585 586 /** 587 * Database form class 588 * This class is tailored after the db control specified during generation 589 */ 590 public static class DatabaseForm extends RowSetForm 591 { 592 593 public DatabaseForm() 594 { 595 super(); 596 } 597 598 private Integer itemnumber; 599 private String itemname; 600 private Integer quantityavailable; 601 private Double price; 602 603 public Integer getItemnumber() 604 { 605 return itemnumber; 606 } 607 608 public void setItemnumber(Integer newOne) 609 { 610 registerChange("itemnumber"); 611 this.itemnumber = newOne; 612 } 613 614 public String getItemname() 615 { 616 return itemname; 617 } 618 619 public void setItemname(String newOne) 620 { 621 registerChange("itemname"); 622 this.itemname = newOne; 623 } 624 625 public Integer getQuantityavailable() 626 { 627 return quantityavailable; 628 } 629 630 public void setQuantityavailable(Integer newOne) 631 { 632 registerChange("quantityavailable"); 633 this.quantityavailable = newOne; 634 } 635 636 public Double getPrice() 637 { 638 return price; 639 } 640 641 public void setPrice(Double newOne) 642 { 643 registerChange("price"); 644 this.price = newOne; 645 } 646 } 647 }`