From b6624a672ca5af2f3830e5c3ebaa62d1bb89a020 Mon Sep 17 00:00:00 2001 From: Brian Ferris Date: Thu, 10 May 2012 07:19:29 +0200 Subject: [PATCH] Issue #5: Improve the Utility of the Trip Problem Report Admin Interface Add additioal database index for BlockLocationRecords to speed up location record lookups. --- .../impl/realtime/BlockLocationRecord.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/onebusaway-transit-data-federation/src/main/java/org/onebusaway/transit_data_federation/impl/realtime/BlockLocationRecord.java b/onebusaway-transit-data-federation/src/main/java/org/onebusaway/transit_data_federation/impl/realtime/BlockLocationRecord.java index 33167b6a1..faa0cce54 100644 --- a/onebusaway-transit-data-federation/src/main/java/org/onebusaway/transit_data_federation/impl/realtime/BlockLocationRecord.java +++ b/onebusaway-transit-data-federation/src/main/java/org/onebusaway/transit_data_federation/impl/realtime/BlockLocationRecord.java @@ -45,8 +45,11 @@ */ @Entity @Table(name = "transit_data_block_location_records") -@org.hibernate.annotations.Table(appliesTo = "transit_data_block_location_records", indexes = {@Index(name = "vehicle_and_time", columnNames = { - "vehicle_agencyId", "vehicle_id", "time"})}) +@org.hibernate.annotations.Table(appliesTo = "transit_data_block_location_records", indexes = { + @Index(name = "vehicle_and_time", columnNames = { + "vehicle_agencyId", "vehicle_id", "time"}), + @Index(name = "vehicle_and_serviceDate", columnNames = { + "vehicle_agencyId", "vehicle_id", "serviceDate"})}) @org.hibernate.annotations.Entity(mutable = false) @Cache(usage = CacheConcurrencyStrategy.READ_ONLY) public class BlockLocationRecord { @@ -88,7 +91,7 @@ public class BlockLocationRecord { @Column(nullable = true) private final Double orientation; - + @Embedded @AttributeOverrides({ @AttributeOverride(name = "agencyId", column = @Column(name = "timepoint_agencyId", length = 50)), @@ -216,7 +219,7 @@ public boolean isDistanceAlongBlockSet() { public Double getDistanceAlongBlock() { return distanceAlongBlock; } - + public Double getDistanceAlongTrip() { return distanceAlongTrip; } @@ -300,7 +303,7 @@ public static class Builder { private Double scheduleDeviation = null; private Double distanceAlongBlock = null; - + private Double distanceAlongTrip = null; private Double locationLat = null;