コード例 #1
0
  public DataPoint setId(int data) {
    boolean changed = m_id.setValue(data);

    // Add the now dirty record to the transaction only if it is not previously dirty
    if (changed) {
      if (m_dirtyFlags.isEmpty()) GenOrmDataSource.getGenOrmConnection().addToTransaction(this);

      m_dirtyFlags.set(ID_FIELD_META.getDirtyFlag());

      if (m_isNewRecord) // Force set the prev value
      m_id.setPrevValue(data);
    }

    return ((DataPoint) this);
  }
コード例 #2
0
  // ---------------------------------------------------------------------------
  protected void initialize(java.sql.ResultSet rs) {
    try {
      if (s_logger.isDebug()) {
        java.sql.ResultSetMetaData meta = rs.getMetaData();
        for (int I = 1; I <= meta.getColumnCount(); I++) {
          s_logger.debug("Reading - " + meta.getColumnName(I) + " : " + rs.getString(I));
        }
      }
      m_id.setValue(rs, 1);
      m_metricId.setValue(rs, 2);
      m_timestamp.setValue(rs, 3);
      m_longValue.setValue(rs, 4);
      m_doubleValue.setValue(rs, 5);

    } catch (java.sql.SQLException sqle) {
      throw new GenOrmException(sqle);
    }
  }
コード例 #3
0
  // ---------------------------------------------------------------------------
  public String toString() {
    StringBuilder sb = new StringBuilder();

    sb.append("id=\"");
    sb.append(m_id.getValue());
    sb.append("\" ");
    sb.append("metric_id=\"");
    sb.append(m_metricId.getValue());
    sb.append("\" ");
    sb.append("timestamp=\"");
    sb.append(m_timestamp.getValue());
    sb.append("\" ");
    sb.append("long_value=\"");
    sb.append(m_longValue.getValue());
    sb.append("\" ");
    sb.append("double_value=\"");
    sb.append(m_doubleValue.getValue());
    sb.append("\" ");

    return (sb.toString().trim());
  }
コード例 #4
0
 // ---------------------------------------------------------------------------
 protected void initialize(int id) {
   m_id.setValue(id);
   m_id.setPrevValue(id);
 }
コード例 #5
0
 public int getId() {
   return (m_id.getValue());
 }