Commit 7ac772c9 authored by Björn Richerzhagen's avatar Björn Richerzhagen
Browse files

Merge branch 'master' into 'releases/v2-3'

Master

Added index annotations, thanks to @rueckert

See merge request !12
parents f1cf5ffb de42d187
......@@ -8,6 +8,7 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.Index;
import org.hibernate.annotations.Type;
/** Database representation of an experiment, that is, a simulator run.
......@@ -31,6 +32,7 @@ public class Experiment {
*/
@Id
@GeneratedValue
@Index(name = "id")
private int id;
/**
......
......@@ -7,6 +7,8 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Index;
@Entity
@Table(name = "hostmetrics")
/** Database mapping between metrics and hosts.
......@@ -21,12 +23,14 @@ public class HostMetric {
@SuppressWarnings("unused")
@Id
@GeneratedValue
@Index(name = "id")
private int id;
private long hostId;
@ManyToOne
@JoinColumn(name = "metricId")
@Index(name = "metricId")
private Metric metric;
protected HostMetric() {
......
......@@ -9,6 +9,8 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Index;
/** Statistical representation of a series of measurements in the database.
*
* This class is a POJO that maps to a table in a database. Instances
......@@ -26,6 +28,7 @@ public class Measurement implements HostMetricBound {
@SuppressWarnings("unused")
@Id
@GeneratedValue
@Index(name = "id")
private int id;
/**
......
......@@ -8,6 +8,7 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Index;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
......@@ -30,6 +31,7 @@ public class MeasurementPair {
@SuppressWarnings("unused")
@Id
@GeneratedValue()
@Index(name = "id")
private int id;
/**
......
......@@ -8,6 +8,7 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Index;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
......@@ -24,6 +25,7 @@ public class MeasurementPairList {
*/
@Id
@GeneratedValue()
@Index(name = "id")
private int id;
/**
......
......@@ -8,6 +8,8 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Index;
/** Statistical representation of a series of measurements in the database.
*
* This class is a POJO that maps to a table in a database. Instances
......@@ -51,6 +53,7 @@ public class MeasurementSingle {
@SuppressWarnings("unused")
@ManyToOne
@JoinColumn(name = "hostMetricId")
@Index(name = "hostMetricId")
private HostMetric hostMetric;
/**
......
......@@ -8,6 +8,8 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Index;
/** Database representation of a metric.
*
* It is nearly an exact equivalent of {@link MetricDescription} but
......@@ -29,6 +31,7 @@ public class Metric {
@SuppressWarnings("unused")
@Id
@GeneratedValue
@Index(name = "id")
private int id;
/**
......@@ -65,6 +68,7 @@ public class Metric {
*/
@ManyToOne
@JoinColumn(name = "experimentId")
@Index(name = "experimentId")
private Experiment experiment;
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment