Exemplo n.º 1
0
  public DataPoint setMetricId(String data) {
    boolean changed = m_metricId.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(METRIC_ID_FIELD_META.getDirtyFlag());

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

    return ((DataPoint) this);
  }
Exemplo n.º 2
0
  // --------------------------------------------------------------------------
  public DataPoint setMetricRef(Metric table) {
    // We add the record to the transaction if one of the key values change
    if (m_metricId.setValue(table.getId())) {
      if ((m_dirtyFlags.isEmpty()) && (GenOrmDataSource.getGenOrmConnection() != null))
        GenOrmDataSource.getGenOrmConnection().addToTransaction(this);

      m_dirtyFlags.set(METRIC_ID_FIELD_META.getDirtyFlag());
    }

    return ((DataPoint) this);
  }
Exemplo n.º 3
0
  public DataPoint setMetricIdNull() {
    boolean changed = m_metricId.setNull();

    if (changed) {
      if (m_dirtyFlags.isEmpty()) GenOrmDataSource.getGenOrmConnection().addToTransaction(this);

      m_dirtyFlags.set(METRIC_ID_FIELD_META.getDirtyFlag());
    }

    return ((DataPoint) this);
  }
Exemplo n.º 4
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);
    }
  }
Exemplo n.º 5
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());
  }
Exemplo n.º 6
0
 // ---------------------------------------------------------------------------
 public Metric getMetricRef() {
   return (Metric.factory.find(m_metricId.getValue()));
 }
Exemplo n.º 7
0
 public boolean isMetricIdNull() {
   return (m_metricId.isNull());
 }
Exemplo n.º 8
0
 public String getMetricId() {
   return (m_metricId.getValue());
 }