Changeset 4075


Ignore:
Timestamp:
Jan 10, 2008, 4:44:11 PM (14 years ago)
Author:
Martin Svensson
Message:

References #879 The database has now been updated, including UML diagram. Implementing this in the web client will be done next.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/Install.java

    r4074 r4075  
    107107    method.
    108108  */
    109   public static final int NEW_SCHEMA_VERSION = Integer.valueOf(47).intValue();
     109  public static final int NEW_SCHEMA_VERSION = Integer.valueOf(48).intValue();
    110110 
    111111  public static synchronized void createTables(boolean update, final ProgressReporter progress)
  • trunk/src/core/net/sf/basedb/core/ReporterBatcher.java

    r3775 r4075  
    148148 
    149149  /**
    150     Set the last update date to today's date.
     150    Set the last update date to today's date and
     151    change the last source of update.
    151152  */
    152153  void onBeforeCommit(ReporterData data, Transactional.Action action)
     
    154155  {
    155156    setPropertyValue(data, "lastUpdate", new Date());
     157    setPropertyValue(data, "lastSource", updateSource != null ? updateSource : "n/a");
    156158  }
    157159  // -------------------------------------------
     
    162164  private org.hibernate.Query findReporter;
    163165 
     166  /**
     167    A string to hold the name of the source,
     168    used to update the reporters.
     169   */
     170  private String updateSource = null;
    164171  /**
    165172    Check if a reporter with a given external id exists in the database or
     
    248255    return r;
    249256  }
     257
     258  /**
     259    Set the source that was used when updating the reporters.
     260    This must be set before committing this batcher.       
     261    @param source The source to be set. The format of the source string
     262      should be like: "[item_type]:[item_name]"   
     263   */
     264  public void setUpdateSource(String source)
     265  {
     266    this.updateSource = source;
     267  }
    250268}
  • trunk/src/core/net/sf/basedb/core/Update.java

    r4074 r4075  
    789789        if (progress != null) progress.display((int)(46*progress_factor), "--Updating schema version: " + schemaVersion + " -> 47...");
    790790        schemaVersion = setSchemaVersionInTransaction(session, 47);
     791      }
     792     
     793      if (schemaVersion < 48)
     794      {
     795        if (progress != null) progress.display((int)(47*progress_factor), "Updating schema version: " + schemaVersion + " -> 48...");
     796        schemaVersion = setSchemaVersionInTransaction(session, 48);
    791797      }
    792798
  • trunk/src/core/net/sf/basedb/core/data/ReporterData.java

    r3948 r4075  
    118118  }
    119119 
     120  /**
     121    The source of the last update
     122   */
     123  private String lastSource;
     124  /**
     125    Get the source that was used when this reporter
     126    was last updated.
     127    @return A <code>String</code> object
     128    @hibernate.property column="`last_source`" type="string" not-null="false"
     129   */
     130  public String getLastSource()
     131  {
     132    return lastSource;
     133  }
     134  void setLastSource(String source)
     135  {
     136    this.lastSource = source;
     137  }
     138 
    120139  /*
    121140    From the NameableData interface
Note: See TracChangeset for help on using the changeset viewer.