se.citerus.dddsample.infrastructure.persistence.hibernate
Class CargoRepositoryHibernate

java.lang.Object
  extended by se.citerus.dddsample.infrastructure.persistence.hibernate.HibernateRepository
      extended by se.citerus.dddsample.infrastructure.persistence.hibernate.CargoRepositoryHibernate
All Implemented Interfaces:
CargoRepository

@Repository
public class CargoRepositoryHibernate
extends HibernateRepository
implements CargoRepository

Hibernate implementation of CargoRepository.


Constructor Summary
CargoRepositoryHibernate()
           
 
Method Summary
 Cargo find(TrackingId tid)
          Finds a cargo using given id.
 java.util.List<Cargo> findAll()
          Finds all cargo.
 TrackingId nextTrackingId()
           
 void store(Cargo cargo)
          Saves given cargo.
 
Methods inherited from class se.citerus.dddsample.infrastructure.persistence.hibernate.HibernateRepository
getSession, setSessionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CargoRepositoryHibernate

public CargoRepositoryHibernate()
Method Detail

find

public Cargo find(TrackingId tid)
Description copied from interface: CargoRepository
Finds a cargo using given id.

Specified by:
find in interface CargoRepository
Parameters:
tid - Id
Returns:
Cargo if found, else null

store

public void store(Cargo cargo)
Description copied from interface: CargoRepository
Saves given cargo.

Specified by:
store in interface CargoRepository
Parameters:
cargo - cargo to save

nextTrackingId

public TrackingId nextTrackingId()
Specified by:
nextTrackingId in interface CargoRepository
Returns:
A unique, generated tracking Id.

findAll

public java.util.List<Cargo> findAll()
Description copied from interface: CargoRepository
Finds all cargo.

Specified by:
findAll in interface CargoRepository
Returns:
All cargo.


Copyright © 2009. All Rights Reserved.