net.sf.blunder.service.persistence.hibernate
Class BlunderHibernateService

java.lang.Object
  extended by net.sf.blunder.service.persistence.hibernate.BlunderHibernateService
All Implemented Interfaces:
BlunderPersistenceService

@Transactional(readOnly=true,
               propagation=NOT_SUPPORTED)
public class BlunderHibernateService
extends Object
implements BlunderPersistenceService

Hibernate implementation for a BlunderPersistenceService. For more information about Hibernate please refer to the project site http://www.hibernate.org.

Author:
Ambrosi Lucas

Constructor Summary
BlunderHibernateService()
           
 
Method Summary
 void delete(ExceptionRelation er)
          Deletes a new ExceptionRelation.
 List<ExceptionRelation> findBy(String leafClassname, String rootClassname, String businessClassname)
          Finds an ExceptionRelation for the following arguments.
 List<ExceptionRelation> findByBusiness(String businessClassname)
          Finds an ExceptionRelation for the following arguments.
 List<ExceptionRelation> findByLeaf(String leafClassname)
          Finds an ExceptionRelation for the following arguments.
 List<ExceptionRelation> findByLeafAndBusiness(String leafClassname, String businessClassname)
          Finds an ExceptionRelation for the following arguments.
 List<ExceptionRelation> findByLeafAndRoot(String leafClassname, String rootClassname)
          Finds an ExceptionRelation for the following arguments.
 List<ExceptionRelation> findByRoot(String rootClassname)
          Finds an ExceptionRelation for the following arguments.
 ExceptionRelation findDefaultRelation()
           
 HibernateTemplate getHibernateTemplate()
           
 void learn(ExceptionRelation er)
          Learns a new ExceptionRelation.
 void refresh()
          Refresh the persistence service.
 void setHibernateTemplate(HibernateTemplate hibernateTemplate)
           
 void update(ExceptionRelation er)
          Updates a known ExceptionRelation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlunderHibernateService

public BlunderHibernateService()
Method Detail

findBy

public List<ExceptionRelation> findBy(String leafClassname,
                                      String rootClassname,
                                      String businessClassname)
                               throws DataAccessException,
                                      org.hibernate.SessionException
Description copied from interface: BlunderPersistenceService
Finds an ExceptionRelation for the following arguments.

Specified by:
findBy in interface BlunderPersistenceService
Parameters:
leafClassname - class name of the highest level Exception in the chain.
rootClassname - class name of the lowest level Exception in the chain.
businessClassname - class name of the business Exception in the chain.
Returns:
a List of ExceptionRelation with all relations that matches with the previous parameters.
Throws:
DataAccessException
org.hibernate.SessionException
See Also:
BlunderPersistenceService.findBy(String,String,String)

findByBusiness

public List<ExceptionRelation> findByBusiness(String businessClassname)
Description copied from interface: BlunderPersistenceService
Finds an ExceptionRelation for the following arguments.

Specified by:
findByBusiness in interface BlunderPersistenceService
Parameters:
businessClassname - class name of the business Exception in the chain.
Returns:
a List of ExceptionRelation with all relations that matches with the previous parameters.
See Also:
BlunderPersistenceService.findByBusiness(String)

findByLeaf

public List<ExceptionRelation> findByLeaf(String leafClassname)
Description copied from interface: BlunderPersistenceService
Finds an ExceptionRelation for the following arguments.

Specified by:
findByLeaf in interface BlunderPersistenceService
Parameters:
leafClassname - class name of the highest level Exception in the chain.
Returns:
a List of ExceptionRelation with all relations that matches with the previous parameters.
See Also:
BlunderPersistenceService.findByLeaf(String)

findByLeafAndBusiness

public List<ExceptionRelation> findByLeafAndBusiness(String leafClassname,
                                                     String businessClassname)
Description copied from interface: BlunderPersistenceService
Finds an ExceptionRelation for the following arguments.

Specified by:
findByLeafAndBusiness in interface BlunderPersistenceService
Parameters:
leafClassname - class name of the highest level Exception in the chain.
businessClassname - class name of the business Exception in the chain.
Returns:
a List of ExceptionRelation with all relations that matches with the previous parameters.
See Also:
BlunderPersistenceService.findByLeafAndBusiness(String,String)

findByLeafAndRoot

public List<ExceptionRelation> findByLeafAndRoot(String leafClassname,
                                                 String rootClassname)
Description copied from interface: BlunderPersistenceService
Finds an ExceptionRelation for the following arguments.

Specified by:
findByLeafAndRoot in interface BlunderPersistenceService
Parameters:
leafClassname - class name of the highest level Exception in the chain.
rootClassname - class name of the lowest level Exception in the chain.
Returns:
a List of ExceptionRelation with all relations that matches with the previous parameters.
See Also:
BlunderPersistenceService.findByLeafAndRoot(String,String)

findByRoot

public List<ExceptionRelation> findByRoot(String rootClassname)
Description copied from interface: BlunderPersistenceService
Finds an ExceptionRelation for the following arguments.

Specified by:
findByRoot in interface BlunderPersistenceService
Parameters:
rootClassname - class name of the lowest level Exception in the chain.
Returns:
a List of ExceptionRelation with all relations that matches with the previous parameters.
See Also:
BlunderPersistenceService.findByRoot(String)

findDefaultRelation

public ExceptionRelation findDefaultRelation()
Specified by:
findDefaultRelation in interface BlunderPersistenceService
Returns:
the default ExceptionRelation.
See Also:
BlunderPersistenceService.findDefaultRelation()

learn

@Transactional(readOnly=false,
               propagation=SUPPORTS)
public void learn(ExceptionRelation er)
           throws DataAccessException,
                  org.hibernate.SessionException
Description copied from interface: BlunderPersistenceService
Learns a new ExceptionRelation.

Specified by:
learn in interface BlunderPersistenceService
Parameters:
er - the ExceptionRelation to learn.
Throws:
DataAccessException
org.hibernate.SessionException
See Also:
BlunderPersistenceService.learn(ExceptionRelation)

update

@Transactional(readOnly=false,
               propagation=SUPPORTS)
public void update(ExceptionRelation er)
Description copied from interface: BlunderPersistenceService
Updates a known ExceptionRelation.

Specified by:
update in interface BlunderPersistenceService
Parameters:
er - the ExceptionRelation to update.
See Also:
BlunderPersistenceService.update(ExceptionRelation)

delete

@Transactional(readOnly=false,
               propagation=SUPPORTS)
public void delete(ExceptionRelation er)
Description copied from interface: BlunderPersistenceService
Deletes a new ExceptionRelation.

Specified by:
delete in interface BlunderPersistenceService
Parameters:
er - the ExceptionRelation to delete.
See Also:
BlunderPersistenceService.delete(ExceptionRelation)

refresh

public void refresh()
Description copied from interface: BlunderPersistenceService
Refresh the persistence service. This should be used to clear all data in the local cache.

Specified by:
refresh in interface BlunderPersistenceService
See Also:
BlunderPersistenceService.refresh()

getHibernateTemplate

public HibernateTemplate getHibernateTemplate()

setHibernateTemplate

public void setHibernateTemplate(HibernateTemplate hibernateTemplate)


Copyright © 2009 Blunder. All Rights Reserved.