org.alfresco.repo.admin.patch.hibernate
Class HibernatePatchDaoServiceImpl

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.alfresco.repo.admin.patch.hibernate.HibernatePatchDaoServiceImpl
All Implemented Interfaces:
PatchDaoService, org.springframework.beans.factory.InitializingBean

public class HibernatePatchDaoServiceImpl
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements PatchDaoService

Hibernate-specific implementation for managing patch persistence.

Since:
1.2

Field Summary
static java.lang.String QUERY_GET_ALL_APPLIED_PATCHES
           
static java.lang.String QUERY_GET_APPLIED_PATCHES_BY_DATE
           
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
HibernatePatchDaoServiceImpl()
           
 
Method Summary
 void detach(AppliedPatch appliedPatch)
          Detaches the given instance from the persistence engine.
 AppliedPatch getAppliedPatch(java.lang.String id)
          Retrieve an existing patch
 java.util.List getAppliedPatches()
          Get a list of all applied patches
 java.util.List getAppliedPatches(java.util.Date fromDate, java.util.Date toDate)
          Get a list of all patches applied between the given dates.
 AppliedPatch newAppliedPatch(java.lang.String id)
          Creates and saves a new instance of the patch.
 void setAppliedOnDate(java.lang.String id, java.util.Date appliedOnDate)
          Update the patch applied on date.
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUERY_GET_ALL_APPLIED_PATCHES

public static final java.lang.String QUERY_GET_ALL_APPLIED_PATCHES
See Also:
Constant Field Values

QUERY_GET_APPLIED_PATCHES_BY_DATE

public static final java.lang.String QUERY_GET_APPLIED_PATCHES_BY_DATE
See Also:
Constant Field Values
Constructor Detail

HibernatePatchDaoServiceImpl

public HibernatePatchDaoServiceImpl()
Method Detail

newAppliedPatch

public AppliedPatch newAppliedPatch(java.lang.String id)
Description copied from interface: PatchDaoService
Creates and saves a new instance of the patch. This will not have all the mandatory properties set - only the ID.

Specified by:
newAppliedPatch in interface PatchDaoService
Parameters:
id - the unique key
Returns:
Returns a new instance that can be manipulated

getAppliedPatch

public AppliedPatch getAppliedPatch(java.lang.String id)
Description copied from interface: PatchDaoService
Retrieve an existing patch

Specified by:
getAppliedPatch in interface PatchDaoService
Parameters:
id - the patch unique ID
Returns:
Returns the patch instance or null if one has not been persisted

detach

public void detach(AppliedPatch appliedPatch)
Description copied from interface: PatchDaoService
Detaches the given instance from the persistence engine. This will ensure that any changes made to the java object do not get persisted, allowing the objects to be passed out to external clients without any concern of their lifecycle.

Specified by:
detach in interface PatchDaoService
Parameters:
appliedPatch - the object to detach from persistence

getAppliedPatches

public java.util.List getAppliedPatches()
Description copied from interface: PatchDaoService
Get a list of all applied patches

Specified by:
getAppliedPatches in interface PatchDaoService
Returns:
Returns a list of all applied patches
See Also:
HibernatePatchDaoServiceImpl.QUERY_GET_ALL_APPLIED_PATCHES

getAppliedPatches

public java.util.List getAppliedPatches(java.util.Date fromDate,
                                        java.util.Date toDate)
Description copied from interface: PatchDaoService
Get a list of all patches applied between the given dates.

Specified by:
getAppliedPatches in interface PatchDaoService
Parameters:
fromDate - the lower date limit or null to ignore
toDate - the upper date limit or null to ignore
Returns:
Returns applied patches for the date range, but also patches without a date
See Also:
HibernatePatchDaoServiceImpl.QUERY_GET_APPLIED_PATCHES_BY_DATE

setAppliedOnDate

public void setAppliedOnDate(java.lang.String id,
                             java.util.Date appliedOnDate)
Description copied from interface: PatchDaoService
Update the patch applied on date.

Specified by:
setAppliedOnDate in interface PatchDaoService
Parameters:
id - the patch ID
appliedOnDate - the date applied


Copyright © 2005 - 2008 Alfresco Software, Inc. All Rights Reserved.