org.onebusaway.gtfs.impl
Class HibernateGtfsRelationalDaoImpl

java.lang.Object
  extended by org.onebusaway.gtfs.impl.HibernateGtfsRelationalDaoImpl
All Implemented Interfaces:
GenericDao, GenericMutableDao, GtfsDao, GtfsMutableDao, GtfsMutableRelationalDao, GtfsRelationalDao

public class HibernateGtfsRelationalDaoImpl
extends java.lang.Object
implements GtfsMutableRelationalDao


Field Summary
protected  HibernateOperations _ops
           
 
Constructor Summary
HibernateGtfsRelationalDaoImpl()
           
HibernateGtfsRelationalDaoImpl(org.hibernate.SessionFactory sessionFactory)
           
 
Method Summary
<T> void
clearAllEntitiesForType(java.lang.Class<T> type)
           
 void close()
           
 java.lang.Object execute(HibernateOperation callback)
           
 void flush()
           
 Agency getAgencyForId(java.lang.String id)
           
 java.util.List<Agency> getAllAgencies()
           
 java.util.List<ServiceCalendarDate> getAllCalendarDates()
           
 java.util.List<ServiceCalendar> getAllCalendars()
           
<T> java.util.Collection<T>
getAllEntitiesForType(java.lang.Class<T> type)
           
 java.util.Collection<FareAttribute> getAllFareAttributes()
           
 java.util.Collection<FareRule> getAllFareRules()
           
 java.util.Collection<Frequency> getAllFrequencies()
           
 java.util.List<Pathway> getAllPathways()
           
 java.util.List<Route> getAllRoutes()
           
 java.util.Collection<ShapePoint> getAllShapePoints()
           
 java.util.List<Stop> getAllStops()
           
 java.util.List<StopTime> getAllStopTimes()
           
 java.util.Collection<Transfer> getAllTransfers()
           
 java.util.List<Trip> getAllTrips()
           
 ServiceCalendarDate getCalendarDateForId(int id)
           
 ServiceCalendar getCalendarForId(int id)
           
<T> T
getEntityForId(java.lang.Class<T> type, java.io.Serializable id)
           
 FareAttribute getFareAttributeForId(AgencyAndId id)
           
 FareRule getFareRuleForId(int id)
           
 java.util.List<Frequency> getFrequenciesForTrip(Trip trip)
           
 Frequency getFrequencyForId(int id)
           
 Pathway getPathwayForId(AgencyAndId agencyAndId)
           
 Route getRouteForId(AgencyAndId id)
           
 java.util.List<Route> getRoutesForAgency(Agency agency)
           
 ShapePoint getShapePointForId(int id)
           
 java.util.List<ShapePoint> getShapePointsForShapeId(AgencyAndId shapeId)
           
 Stop getStopForId(AgencyAndId agencyAndId)
           
 StopTime getStopTimeForId(int id)
           
 java.util.List<StopTime> getStopTimesForStop(Stop stop)
           
 java.util.List<StopTime> getStopTimesForTrip(Trip trip)
           
 Transfer getTransferForId(int id)
           
 java.util.List<java.lang.String> getTripAgencyIdsReferencingServiceId(AgencyAndId serviceId)
          GtfsRelationalDao Interface
 Trip getTripForId(AgencyAndId id)
           
 java.util.List<Trip> getTripsForRoute(Route route)
           
 void open()
          Mutable Methods
<K extends java.io.Serializable,T extends IdentityBean<K>>
void
removeEntity(T entity)
           
 void saveEntity(java.lang.Object entity)
           
 void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_ops

protected HibernateOperations _ops
Constructor Detail

HibernateGtfsRelationalDaoImpl

public HibernateGtfsRelationalDaoImpl()

HibernateGtfsRelationalDaoImpl

public HibernateGtfsRelationalDaoImpl(org.hibernate.SessionFactory sessionFactory)
Method Detail

setSessionFactory

public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)

execute

public java.lang.Object execute(HibernateOperation callback)

getAllEntitiesForType

public <T> java.util.Collection<T> getAllEntitiesForType(java.lang.Class<T> type)
Specified by:
getAllEntitiesForType in interface GenericDao

getEntityForId

public <T> T getEntityForId(java.lang.Class<T> type,
                            java.io.Serializable id)
Specified by:
getEntityForId in interface GenericDao

getAllAgencies

public java.util.List<Agency> getAllAgencies()
Specified by:
getAllAgencies in interface GtfsDao

getAllCalendars

public java.util.List<ServiceCalendar> getAllCalendars()
Specified by:
getAllCalendars in interface GtfsDao

getAllCalendarDates

public java.util.List<ServiceCalendarDate> getAllCalendarDates()
Specified by:
getAllCalendarDates in interface GtfsDao

getAllFareAttributes

public java.util.Collection<FareAttribute> getAllFareAttributes()
Specified by:
getAllFareAttributes in interface GtfsDao

getAllFareRules

public java.util.Collection<FareRule> getAllFareRules()
Specified by:
getAllFareRules in interface GtfsDao

getAllFrequencies

public java.util.Collection<Frequency> getAllFrequencies()
Specified by:
getAllFrequencies in interface GtfsDao

getAllRoutes

public java.util.List<Route> getAllRoutes()
Specified by:
getAllRoutes in interface GtfsDao

getAllStops

public java.util.List<Stop> getAllStops()
Specified by:
getAllStops in interface GtfsDao

getAllPathways

public java.util.List<Pathway> getAllPathways()
Specified by:
getAllPathways in interface GtfsDao

getAllTrips

public java.util.List<Trip> getAllTrips()
Specified by:
getAllTrips in interface GtfsDao

getAllStopTimes

public java.util.List<StopTime> getAllStopTimes()
Specified by:
getAllStopTimes in interface GtfsDao

getAllShapePoints

public java.util.Collection<ShapePoint> getAllShapePoints()
Specified by:
getAllShapePoints in interface GtfsDao

getAllTransfers

public java.util.Collection<Transfer> getAllTransfers()
Specified by:
getAllTransfers in interface GtfsDao

getAgencyForId

public Agency getAgencyForId(java.lang.String id)
Specified by:
getAgencyForId in interface GtfsDao

getFareAttributeForId

public FareAttribute getFareAttributeForId(AgencyAndId id)
Specified by:
getFareAttributeForId in interface GtfsDao

getFareRuleForId

public FareRule getFareRuleForId(int id)
Specified by:
getFareRuleForId in interface GtfsDao

getFrequencyForId

public Frequency getFrequencyForId(int id)
Specified by:
getFrequencyForId in interface GtfsDao

getPathwayForId

public Pathway getPathwayForId(AgencyAndId agencyAndId)
Specified by:
getPathwayForId in interface GtfsDao

getRouteForId

public Route getRouteForId(AgencyAndId id)
Specified by:
getRouteForId in interface GtfsDao

getCalendarForId

public ServiceCalendar getCalendarForId(int id)
Specified by:
getCalendarForId in interface GtfsDao

getCalendarDateForId

public ServiceCalendarDate getCalendarDateForId(int id)
Specified by:
getCalendarDateForId in interface GtfsDao

getShapePointForId

public ShapePoint getShapePointForId(int id)
Specified by:
getShapePointForId in interface GtfsDao

getStopForId

public Stop getStopForId(AgencyAndId agencyAndId)
Specified by:
getStopForId in interface GtfsDao

getStopTimeForId

public StopTime getStopTimeForId(int id)
Specified by:
getStopTimeForId in interface GtfsDao

getTransferForId

public Transfer getTransferForId(int id)
Specified by:
getTransferForId in interface GtfsDao

getTripForId

public Trip getTripForId(AgencyAndId id)
Specified by:
getTripForId in interface GtfsDao

getTripAgencyIdsReferencingServiceId

public java.util.List<java.lang.String> getTripAgencyIdsReferencingServiceId(AgencyAndId serviceId)
GtfsRelationalDao Interface

Specified by:
getTripAgencyIdsReferencingServiceId in interface GtfsRelationalDao

getRoutesForAgency

public java.util.List<Route> getRoutesForAgency(Agency agency)
Specified by:
getRoutesForAgency in interface GtfsRelationalDao

getTripsForRoute

public java.util.List<Trip> getTripsForRoute(Route route)
Specified by:
getTripsForRoute in interface GtfsRelationalDao

getStopTimesForTrip

public java.util.List<StopTime> getStopTimesForTrip(Trip trip)
Specified by:
getStopTimesForTrip in interface GtfsRelationalDao

getStopTimesForStop

public java.util.List<StopTime> getStopTimesForStop(Stop stop)
Specified by:
getStopTimesForStop in interface GtfsRelationalDao

getShapePointsForShapeId

public java.util.List<ShapePoint> getShapePointsForShapeId(AgencyAndId shapeId)
Specified by:
getShapePointsForShapeId in interface GtfsRelationalDao

getFrequenciesForTrip

public java.util.List<Frequency> getFrequenciesForTrip(Trip trip)
Specified by:
getFrequenciesForTrip in interface GtfsRelationalDao

open

public void open()
Mutable Methods

Specified by:
open in interface GenericMutableDao

close

public void close()
Specified by:
close in interface GenericMutableDao

flush

public void flush()
Specified by:
flush in interface GenericMutableDao

removeEntity

public <K extends java.io.Serializable,T extends IdentityBean<K>> void removeEntity(T entity)
Specified by:
removeEntity in interface GenericMutableDao

saveEntity

public void saveEntity(java.lang.Object entity)
Specified by:
saveEntity in interface GenericMutableDao

clearAllEntitiesForType

public <T> void clearAllEntitiesForType(java.lang.Class<T> type)
Specified by:
clearAllEntitiesForType in interface GenericMutableDao


Copyright © 2010 OneBusAway. All Rights Reserved.