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    
006    package fc.jdbc.dbo;
007    
008    import java.io.*;
009    import java.sql.*;
010    import java.util.*;
011    
012    import fc.jdbc.*;
013    import fc.io.*;
014    import fc.util.*;
015    
016    /**
017    The base dbo class which is extended by all generated
018    dbo classes.
019    
020    @author hursh jain
021    */
022    public class DBO
023    {
024    protected boolean   isDiscarded;
025    
026    /**
027    Constructs a new DBO object. The object is set to
028    be valid.
029    */
030    protected DBO() 
031      {
032      this.isDiscarded = false;
033      } 
034    
035    /** 
036    Returns <tt>true</tt> if this object has been discarded.
037    Objects are discarded after they have been saved to the 
038    database. 
039    */
040    public boolean isDiscarded()
041      {
042      return this.isDiscarded;
043      }
044    
045    /** 
046    "discards" this object. After an object is discarded, it's
047    contents are considered invalid and any attempt to save this
048    object will fail. This is a non-reversible procedure,
049    meaning an object cannot be marked as non-discarded after
050    calling this method.
051    */
052    public void discard() 
053      {
054      this.isDiscarded = true;
055      }
056    
057    }