/** * Convenience method for selecting records. Ideally this should not be use, instead a custom * query for this table should be used. * * @param where sql where statement. * @param orderBy sql order by statement */ public ResultSet select(String where, String orderBy) { ResultSet rs = null; java.sql.Statement stmnt = null; try { stmnt = GenOrmDataSource.createStatement(); StringBuilder sb = new StringBuilder(); sb.append(SELECT); sb.append(FROM); if (where != null) { sb.append(WHERE); sb.append(where); } if (orderBy != null) { sb.append(" "); sb.append(orderBy); } String query = sb.toString(); rs = new SQLResultSet(stmnt.executeQuery(query), query, stmnt); } catch (java.sql.SQLException sqle) { try { if (stmnt != null) stmnt.close(); } catch (java.sql.SQLException sqle2) { } throw new GenOrmException(sqle); } return (rs); }
// --------------------------------------------------------------------------- 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()); }