@Immutable
@Entity
public class Match
extends java.lang.Object
implements org.hibernate.classic.Lifecycle, java.io.Serializable
Serializable since Hibernate requires such.
Implements Lifecycle so that can have the onLoad() callback be called when reading in data so that can intern() member strings. In order to do this the String members could not be declared as final since they are updated after the constructor is called.
Constructor and Description |
---|
Match(VehicleState vehicleState)
Simple constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Because using a composite Id Hibernate wants this member.
|
java.lang.String |
getBlockId() |
int |
getConfigRev() |
java.util.Date |
getDate() |
float |
getDistanceAlongSegment() |
float |
getDistanceAlongStopPath() |
static java.util.List<Match> |
getMatchesFromDb(java.lang.String projectId,
java.util.Date beginTime,
java.util.Date endTime,
java.lang.String sqlClause,
int firstResult,
int maxResults)
Allows batch retrieval of Match data from database.
|
int |
getSegmentIndex() |
java.lang.String |
getServiceId() |
int |
getStopPathIndex() |
long |
getTime() |
java.lang.String |
getTripId() |
java.lang.String |
getVehicleId() |
int |
hashCode()
Because using a composite Id Hibernate wants this member.
|
boolean |
isAtStop()
Returns true if vehicle is at or near a stop.
|
boolean |
onDelete(org.hibernate.Session s)
Implemented due to Lifecycle interface being implemented.
|
void |
onLoad(org.hibernate.Session s,
java.io.Serializable id)
Callback due to implementing Lifecycle interface.
|
boolean |
onSave(org.hibernate.Session s)
Implemented due to Lifecycle interface being implemented.
|
boolean |
onUpdate(org.hibernate.Session s)
Implemented due to Lifecycle interface being implemented.
|
java.lang.String |
toString() |
public Match(VehicleState vehicleState)
vehicleState
- public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static java.util.List<Match> getMatchesFromDb(java.lang.String projectId, java.util.Date beginTime, java.util.Date endTime, java.lang.String sqlClause, int firstResult, int maxResults)
projectId
- beginTime
- endTime
- sqlClause
- The clause is added to the SQL for retrieving the
arrival/departures. Useful for ordering the results. Can be
null.firstResult
- maxResults
- public java.lang.String getVehicleId()
public java.util.Date getDate()
public long getTime()
public int getConfigRev()
public java.lang.String getServiceId()
public java.lang.String getBlockId()
public java.lang.String getTripId()
public int getStopPathIndex()
public int getSegmentIndex()
public float getDistanceAlongSegment()
public float getDistanceAlongStopPath()
public boolean isAtStop()
public void onLoad(org.hibernate.Session s, java.io.Serializable id) throws org.hibernate.CallbackException
onLoad
in interface org.hibernate.classic.Lifecycle
org.hibernate.CallbackException
public boolean onSave(org.hibernate.Session s) throws org.hibernate.CallbackException
onSave
in interface org.hibernate.classic.Lifecycle
org.hibernate.CallbackException
public boolean onUpdate(org.hibernate.Session s) throws org.hibernate.CallbackException
onUpdate
in interface org.hibernate.classic.Lifecycle
org.hibernate.CallbackException
public boolean onDelete(org.hibernate.Session s) throws org.hibernate.CallbackException
onDelete
in interface org.hibernate.classic.Lifecycle
org.hibernate.CallbackException