org.jasig.portal.portlet.dao.jpa
Class JpaPortletEntityDao

java.lang.Object
  extended by org.jasig.portal.portlet.dao.jpa.JpaPortletEntityDao
All Implemented Interfaces:
IPortletEntityDao

@Repository
public class JpaPortletEntityDao
extends Object
implements IPortletEntityDao

Version:
$Revision$
Author:
Eric Dalquist

Constructor Summary
JpaPortletEntityDao()
           
 
Method Summary
 IPortletEntity createPortletEntity(IPortletDefinitionId portletDefinitionId, String channelSubscribeId, int userId)
          Creates, initializes and persists a new IPortletEntity based on the specified IPortletDefinitionId, channel subscribe id and user id.
 void deletePortletEntity(IPortletEntity portletEntity)
          Removes the specified IPortletEntity from the persistent store.
 EntityManager getEntityManager()
           
 IPortletDefinitionDao getPortletDefinitionDao()
           
 Set<IPortletEntity> getPortletEntities(IPortletDefinitionId portletDefinitionId)
          Get all IPortletEntitys based on the specified IPortletDefinitionId.
 Set<IPortletEntity> getPortletEntitiesForUser(int userId)
          Get all IPortletEntitys that exist for the specified user id.
 IPortletEntity getPortletEntity(IPortletEntityId portletEntityId)
          Get a IPortletEntity for the specified IPortletEntityId.
 IPortletEntity getPortletEntity(String channelSubscribeId, int userId)
          Get a IPortletEntity for the specified channel subscribe id and user id.
 void setEntityManager(EntityManager entityManager)
           
 void setPortletDefinitionDao(IPortletDefinitionDao portletDefinitionDao)
           
 void updatePortletEntity(IPortletEntity portletEntity)
          Persists changes to a IPortletEntity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JpaPortletEntityDao

public JpaPortletEntityDao()
Method Detail

getEntityManager

public EntityManager getEntityManager()
Returns:
the entityManager

setEntityManager

public void setEntityManager(EntityManager entityManager)
Parameters:
entityManager - the entityManager to set

getPortletDefinitionDao

public IPortletDefinitionDao getPortletDefinitionDao()
Returns:
the portletDefinitionDao

setPortletDefinitionDao

public void setPortletDefinitionDao(IPortletDefinitionDao portletDefinitionDao)
Parameters:
portletDefinitionDao - the portletDefinitionDao to set

createPortletEntity

@Transactional
public IPortletEntity createPortletEntity(IPortletDefinitionId portletDefinitionId,
                                                        String channelSubscribeId,
                                                        int userId)
Description copied from interface: IPortletEntityDao
Creates, initializes and persists a new IPortletEntity based on the specified IPortletDefinitionId, channel subscribe id and user id.

Specified by:
createPortletEntity in interface IPortletEntityDao
Parameters:
portletDefinitionId - The id of the IPortletDefinition that is the parent of the new entity
channelSubscribeId - The subscription id for the channel the entity is based on in the user's layout.
userId - The id of the user the entity is for.
Returns:
A newly created, initialized and persisted entity.

deletePortletEntity

@Transactional
public void deletePortletEntity(IPortletEntity portletEntity)
Description copied from interface: IPortletEntityDao
Removes the specified IPortletEntity from the persistent store.

Specified by:
deletePortletEntity in interface IPortletEntityDao
Parameters:
portletEntity - The entity to remove.

getPortletEntity

public IPortletEntity getPortletEntity(IPortletEntityId portletEntityId)
Description copied from interface: IPortletEntityDao
Get a IPortletEntity for the specified IPortletEntityId.

Specified by:
getPortletEntity in interface IPortletEntityDao
Parameters:
portletEntityId - The id to get the entity for.
Returns:
The portlet entity for the id, null if no entity exists for the id.

getPortletEntity

public IPortletEntity getPortletEntity(String channelSubscribeId,
                                       int userId)
Description copied from interface: IPortletEntityDao
Get a IPortletEntity for the specified channel subscribe id and user id.

Specified by:
getPortletEntity in interface IPortletEntityDao
Parameters:
channelSubscribeId - The channel subscription id from the user's layout to get the entity for
userId - The user id to get the entity for
Returns:
The portlet entity for the id, null if no entity exists for the ids.

getPortletEntities

public Set<IPortletEntity> getPortletEntities(IPortletDefinitionId portletDefinitionId)
Description copied from interface: IPortletEntityDao
Get all IPortletEntitys based on the specified IPortletDefinitionId.

Specified by:
getPortletEntities in interface IPortletEntityDao
Parameters:
portletDefinitionId - The ID of the parent portlet definition
Returns:
A set of all entities based on the specified portlet definition id, will be empty if no entities exist for the id, will never be null.

getPortletEntitiesForUser

public Set<IPortletEntity> getPortletEntitiesForUser(int userId)
Description copied from interface: IPortletEntityDao
Get all IPortletEntitys that exist for the specified user id. (From IPerson.getID().

Specified by:
getPortletEntitiesForUser in interface IPortletEntityDao
Parameters:
userId - The id of the user to get the entities for.
Returns:
A set of all entities base on the specified user id, will be empty if no entities exist for the id, will never be null.

updatePortletEntity

@Transactional
public void updatePortletEntity(IPortletEntity portletEntity)
Description copied from interface: IPortletEntityDao
Persists changes to a IPortletEntity.

Specified by:
updatePortletEntity in interface IPortletEntityDao
Parameters:
portletEntity - The portlet entity to store the changes for


Copyright © 2010 Jasig. All Rights Reserved.