public class

HibernateSpaceGroupDao

extends ConfluenceHibernateObjectDao
implements SpaceGroupDao
java.lang.Object
   ↳ org.springframework.dao.support.DaoSupport
     ↳ org.springframework.orm.hibernate.support.HibernateDaoSupport
       ↳ com.atlassian.hibernate.HibernateObjectDao
         ↳ com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao<T extends com.atlassian.core.bean.EntityObject>
           ↳ com.atlassian.confluence.core.persistence.hibernate.ConfluenceHibernateObjectDao
             ↳ com.atlassian.confluence.spaces.persistence.dao.hibernate.HibernateSpaceGroupDao

Summary

Fields
public static final String CACHE_KEY_SPACEGROUP_KEY_TO_SPACEGROUPID
[Expand]
Inherited Fields
From class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
From class com.atlassian.hibernate.HibernateObjectDao
From class org.springframework.dao.support.DaoSupport
Public Constructors
HibernateSpaceGroupDao()
Public Methods
int findSpaceTotal(SpaceGroup spaceGroup)
Fast way to count Spaces in a SpaceGroup without loading them.
SpaceGroup getById(long id)
Class getPersistentClass()
SpaceGroup getSpaceGroup(String spaceGroupKey)
first tries to fetch the spaceGroup from the cache by space id if not, fetch it from database
void remove(EntityObject entity)
Override the parent remove method as we want to remove the object out of the cache as well
Protected Methods
EntityObject getByClassId(long l)
Retrieve the object with a particular id from the database.
[Expand]
Inherited Methods
From class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
From class com.atlassian.hibernate.HibernateObjectDao
From class org.springframework.orm.hibernate.support.HibernateDaoSupport
From class org.springframework.dao.support.DaoSupport
From class java.lang.Object
From interface bucket.core.persistence.ObjectDao
From interface com.atlassian.confluence.core.persistence.VersionedObjectDao
From interface com.atlassian.confluence.spaces.persistence.dao.SpaceGroupDao
From interface org.springframework.beans.factory.InitializingBean

Fields

public static final String CACHE_KEY_SPACEGROUP_KEY_TO_SPACEGROUPID

Public Constructors

public HibernateSpaceGroupDao ()

Public Methods

public int findSpaceTotal (SpaceGroup spaceGroup)

Fast way to count Spaces in a SpaceGroup without loading them.

Returns
  • returns the number of all spaces within a spaceGroup

public SpaceGroup getById (long id)

public Class getPersistentClass ()

public SpaceGroup getSpaceGroup (String spaceGroupKey)

first tries to fetch the spaceGroup from the cache by space id if not, fetch it from database

public void remove (EntityObject entity)

Override the parent remove method as we want to remove the object out of the cache as well

Parameters
entity the object to remove

Protected Methods

protected EntityObject getByClassId (long l)

Retrieve the object with a particular id from the database. The object must be of the same class as the DAO's getPersistentClass() method returns.

Parameters
l the id of the object to look up
Returns
  • the corresponding object, or null if the object does not exist with the appropriate class and id.