001// Copyright (c) 2001 Hursh Jain (http://www.mollypages.org) 
002// The Molly framework is freely distributable under the terms of an
003// MIT-style license. For details, see the molly pages web site at:
004// http://www.mollypages.org/. Use, modify, have fun !
005
006package fc.jdbc.dbo;
007
008import java.io.*;
009import java.sql.*;
010import java.util.*;
011
012import fc.jdbc.*;
013import fc.io.*;
014import fc.util.*;
015
016/**
017The base dbo class which is extended by all generated
018dbo classes.
019
020@author hursh jain
021*/
022public class DBO
023{
024protected boolean   isDiscarded;
025
026/**
027Constructs a new DBO object. The object is set to
028be valid.
029*/
030protected DBO() 
031  {
032  this.isDiscarded = false;
033  } 
034
035/** 
036Returns <tt>true</tt> if this object has been discarded.
037Objects are discarded after they have been saved to the 
038database. 
039*/
040public boolean isDiscarded()
041  {
042  return this.isDiscarded;
043  }
044
045/** 
046"discards" this object. After an object is discarded, it's
047contents are considered invalid and any attempt to save this
048object will fail. This is a non-reversible procedure,
049meaning an object cannot be marked as non-discarded after
050calling this method.
051*/
052public void discard() 
053  {
054  this.isDiscarded = true;
055  }
056
057}