Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

deleted flag for Contractor object

Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
should I keep deleted flag inside my Contractor object .
What is meaning of
[B]"1 byte "deleted" flag. 0 implies valid record, 1 implies deleted record "[/B.It is written in Data Section of Data File Format in Sun Instruction

I define these fields in Contractor Object .

private int recordNumber;
private String subcontractorName = "";
private String city = "";
private String typesOfWorkPerformed = "";
private int numberOfStaffInOrganization;
private int hourlyRate;
private long cutomerId;

does my contractor object has enough field ??

where to define deleted flag ?

Please give your inputs ...
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am also working on B&S 2.2.3 and not started the coding. look at this link Delete Flag

Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am starting on the B&S 2.2.2 which also has a deleted flag. In my opinion, this flag really comes into play when a record has to be created. I have a requirement, and probably you as well, to possibly reuse deleted record when creating a new record. I don't see the point of having the deleted flag in the Contractor object.

Incidently, I have posted a few questions on the createMethod() a couple days ago, which if you can, I would be grateful for an opinion.

Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi pkarnani,
The database schema in assignment requirements has not defined anything like recordnumber.
For the sake of record number you have to rely on offset of bytes on which the record is lying in the file.
And where you have defined recordNumber you can define the delete flag there in the begning of the record as a short.

Though I am still in the analysis and design mode: btw why do you need a contractor object.

Squanch that. And squanch this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic