Chapter 13 Snippets

p. 425

Step 3:

import oracle.jbo.domain.Number;

p. 426

Step 4, check top of page:

public Number audit(Number salaryThreshold, discount  Number reportsThreshold)
{
int managersFired = 0;
return new Number(managersFired);
}

Step 3:

import oracle.jbo.domain.Number;

Step 4, find near bottom of page:

public Number auditManagers(Number salaryThreshold, Number reportsThreshold)
{
return getAllManagers().audit(salaryThreshold, reportsThreshold);
}

p. 431

Step 3, near bottom of page:

RowSetIterator secondaryIterator = createRowSetIterator(null);

Step 5, bottom of page:

ManagersViewRowImpl currentMgr;
while (secondaryIterator.hasNext())
{
currentMgr =
(ManagersViewRowImpl) secondaryIterator.next();
managersFired++;
}

p. 432

Step 6, near top of page:

secondaryIterator.closeRowSetIterator();

p. 433

Step 2:

ViewCriteria mgrCriteria = createViewCriteria();

Step 4:

ViewCriteriaRow manRow = mgrCriteria.createViewCriteriaRow();
manRow.setAttribute("Salary", "> " + salaryThreshold);
manRow.setAttribute("NumReports", "< " + reportsThreshold);
mgrCriteria.addElement(manRow);

Step 6:

applyViewCriteria(mgrCriteria);
executeQuery();

Step 7:

applyViewCriteria(null);
executeQuery();

p. 434

Step 3, near bottom of page:

RowIterator reportsIter;
EmployeesViewRowImpl currentRpt;

Step 6, bottom of page:

reportsIter = currentMgr.getReportsView();

p. 435

Step 7:

while (reportsIter.hasNext())
{
currentRpt = (EmployeesViewRowImpl) reportsIter.next();
}

Bulleted step:

currentRpt.setManagerId(new Number(100));

Step 1, middle of page:

currentMgr.remove();

p. 439

Step 3, top of page:

public void addReportsToPastJobs()
{
createViewLink(
"ReportsToPastJobs",
"hrapp.model.datamodel.EmpPastJobsLink",
getManagerReports(),
getReportPastJobs() );
}

Step 1, middle of page:

public void removeReportsToPastJobs()
{
ViewLink linkForRemoval =
this.findViewLink("ReportsToPastJobs");
linkForRemoval.remove();
}