diff --git a/src/de/tud/kom/p2psim/impl/util/db/metric/CustomMeasurement.java b/src/de/tud/kom/p2psim/impl/util/db/metric/CustomMeasurement.java index 4f08243d5ee48c895f03d9683b0ee54cf4c669f2..67a05523503ea9e5e6e76373e06a95515f84f8d1 100644 --- a/src/de/tud/kom/p2psim/impl/util/db/metric/CustomMeasurement.java +++ b/src/de/tud/kom/p2psim/impl/util/db/metric/CustomMeasurement.java @@ -25,6 +25,7 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.Index; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.JoinColumn; @@ -32,7 +33,7 @@ import javax.persistence.ManyToOne; import javax.persistence.Table; @Entity -@Table(name = "custom_measurements") +@Table(name = "custom_measurements", indexes = { @Index(columnList = "hostMetricId", name = "hostMetricId") }) @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public class CustomMeasurement implements HostMetricBound { /** diff --git a/src/de/tud/kom/p2psim/impl/util/db/metric/Experiment.java b/src/de/tud/kom/p2psim/impl/util/db/metric/Experiment.java index 00150e4c74bf9ae7d2099c72e483a91c17f1c02e..0f76dbead9655662d6cfef8baf606d4b0c669656 100644 --- a/src/de/tud/kom/p2psim/impl/util/db/metric/Experiment.java +++ b/src/de/tud/kom/p2psim/impl/util/db/metric/Experiment.java @@ -6,9 +6,9 @@ import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.Index; import javax.persistence.Table; -import org.hibernate.annotations.Index; import org.hibernate.annotations.Type; /** Database representation of an experiment, that is, a simulator run. @@ -25,14 +25,13 @@ import org.hibernate.annotations.Type; * @version 1.0, 07/05/2011 */ @Entity -@Table(name = "experiments") +@Table(name = "experiments", indexes = { @Index(columnList = "id", name = "id") }) public class Experiment { /** * A unique id of this experiment, which will be set by the database. */ @Id @GeneratedValue - @Index(name = "id") private int id; /** diff --git a/src/de/tud/kom/p2psim/impl/util/db/metric/HostMetric.java b/src/de/tud/kom/p2psim/impl/util/db/metric/HostMetric.java index 3ce100bb725dfd78ff10191920aaff6a4c988970..96dbde1cbc7c66980a6c99f46feec91237ae0444 100644 --- a/src/de/tud/kom/p2psim/impl/util/db/metric/HostMetric.java +++ b/src/de/tud/kom/p2psim/impl/util/db/metric/HostMetric.java @@ -3,14 +3,16 @@ package de.tud.kom.p2psim.impl.util.db.metric; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.Index; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; -import org.hibernate.annotations.Index; - @Entity -@Table(name = "hostmetrics") +@Table(name = "hostmetrics", indexes = { + @Index(columnList = "id", name = "id"), + @Index(columnList = "hostId", name = "hostId"), + @Index(columnList = "metricId", name = "metricId") }) /** Database mapping between metrics and hosts. * * This class is a POJO that maps to a table in a database. Instances @@ -23,14 +25,12 @@ 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() { diff --git a/src/de/tud/kom/p2psim/impl/util/db/metric/Measurement.java b/src/de/tud/kom/p2psim/impl/util/db/metric/Measurement.java index 899338f3dbc49e8476d4761d3f53038ba53b9fd9..47869942941faf25b80376358ec8328050d20b6e 100644 --- a/src/de/tud/kom/p2psim/impl/util/db/metric/Measurement.java +++ b/src/de/tud/kom/p2psim/impl/util/db/metric/Measurement.java @@ -5,12 +5,11 @@ import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.Index; 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 @@ -20,7 +19,7 @@ import org.hibernate.annotations.Index; * @author Andreas Hemel */ @Entity -@Table(name = "measurements") +@Table(name = "measurements", indexes = { @Index(columnList = "id", name = "id") }) public class Measurement implements HostMetricBound { /** * The id of this table @@ -28,7 +27,6 @@ public class Measurement implements HostMetricBound { @SuppressWarnings("unused") @Id @GeneratedValue - @Index(name = "id") private int id; /** diff --git a/src/de/tud/kom/p2psim/impl/util/db/metric/MeasurementPair.java b/src/de/tud/kom/p2psim/impl/util/db/metric/MeasurementPair.java index 6dbe8561ccaf75be04700a94765df64bd195ff02..12e8c63ab6ff20dd4fdedf05cefc39e8d829b1d8 100644 --- a/src/de/tud/kom/p2psim/impl/util/db/metric/MeasurementPair.java +++ b/src/de/tud/kom/p2psim/impl/util/db/metric/MeasurementPair.java @@ -4,11 +4,11 @@ import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.Index; 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; @@ -23,7 +23,7 @@ import org.hibernate.annotations.OnDeleteAction; * @author Andreas Hemel */ @Entity -@Table(name = "measurements_pair") +@Table(name = "measurements_pair", indexes = { @Index(columnList = "id", name = "id") }) public class MeasurementPair { /** * A unique Id, will be set by the database @@ -31,7 +31,6 @@ public class MeasurementPair { @SuppressWarnings("unused") @Id @GeneratedValue() - @Index(name = "id") private int id; /** diff --git a/src/de/tud/kom/p2psim/impl/util/db/metric/MeasurementPairList.java b/src/de/tud/kom/p2psim/impl/util/db/metric/MeasurementPairList.java index 72bb88dc2aa894a8a111a2e7ef0edd0c7dee4922..06cc149560af8652149d77587d05c9939997b4e6 100644 --- a/src/de/tud/kom/p2psim/impl/util/db/metric/MeasurementPairList.java +++ b/src/de/tud/kom/p2psim/impl/util/db/metric/MeasurementPairList.java @@ -4,11 +4,11 @@ import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.Index; 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; @@ -18,14 +18,13 @@ import org.hibernate.annotations.OnDeleteAction; * @author Björn Richerzhagen */ @Entity -@Table(name = "measurements_pairlist") +@Table(name = "measurements_pairlist", indexes = { @Index(columnList = "id", name = "id") }) public class MeasurementPairList { /** * A unique Id, will be set by the database */ @Id @GeneratedValue() - @Index(name = "id") private int id; /** diff --git a/src/de/tud/kom/p2psim/impl/util/db/metric/MeasurementSingle.java b/src/de/tud/kom/p2psim/impl/util/db/metric/MeasurementSingle.java index 4bfe784fb56cb64c758efb744de33fafba3e2e13..381a434331a95b9e9bc9150a07290b68f745ea5b 100644 --- a/src/de/tud/kom/p2psim/impl/util/db/metric/MeasurementSingle.java +++ b/src/de/tud/kom/p2psim/impl/util/db/metric/MeasurementSingle.java @@ -4,12 +4,11 @@ import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.Index; 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 @@ -23,7 +22,9 @@ import org.hibernate.annotations.Index; * @author Andreas Hemel */ @Entity -@Table(name = "measurements_single") +@Table(name = "measurements_single", indexes = { + @Index(columnList = "time", name = "time"), + @Index(columnList = "hostMetricId", name = "hostMetricId") }) public class MeasurementSingle { /** * A unique Id, will be set by the database @@ -53,7 +54,6 @@ public class MeasurementSingle { @SuppressWarnings("unused") @ManyToOne @JoinColumn(name = "hostMetricId") - @Index(name = "hostMetricId") private HostMetric hostMetric; /** diff --git a/src/de/tud/kom/p2psim/impl/util/db/metric/Metric.java b/src/de/tud/kom/p2psim/impl/util/db/metric/Metric.java index 9ef3de9efbf66a42a261ee9b57b6d3453272ed7d..53e0aa4d424f9956bd4df2e50b1e6b2e3bf6d776 100644 --- a/src/de/tud/kom/p2psim/impl/util/db/metric/Metric.java +++ b/src/de/tud/kom/p2psim/impl/util/db/metric/Metric.java @@ -4,12 +4,11 @@ import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.Index; 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 @@ -23,7 +22,8 @@ import org.hibernate.annotations.Index; * @author Andreas Hemel */ @Entity -@Table(name = "metrics") +@Table(name = "metrics", indexes = { @Index(columnList = "id", name = "id"), + @Index(columnList = "experimentId", name = "experimentId") }) public class Metric { /** * The unique id for this table, which is created by the database @@ -31,7 +31,6 @@ public class Metric { @SuppressWarnings("unused") @Id @GeneratedValue - @Index(name = "id") private int id; /** @@ -68,7 +67,6 @@ public class Metric { */ @ManyToOne @JoinColumn(name = "experimentId") - @Index(name = "experimentId") private Experiment experiment; /**