public abstract class AttachmentDaoBase extends org.springframework.orm.hibernate3.support.HibernateDaoSupport implements AttachmentDao
Base Spring DAO Class: is able to create, update, remove, load, and find objects of type
com.communote.server.persistence.resource.Attachment
.
Attachment
TRANSFORM_NONE
Constructor and Description |
---|
AttachmentDaoBase() |
Modifier and Type | Method and Description |
---|---|
Attachment |
create(Attachment attachment)
Creates an instance of Attachment and adds it to the persistent store.
|
Collection<Attachment> |
create(Collection<Attachment> entities)
Creates a new instance of Attachment and adds from the passed in
entities
collection |
Object |
create(int transform,
Attachment attachment)
Does the same thing as
AttachmentDao.create(Attachment) with an additional flag called
transform . |
Collection<Attachment> |
create(int transform,
Collection<Attachment> entities)
Does the same thing as
AttachmentDao.create(Attachment) with an additional flag called
transform . |
void |
evict(Attachment entity)
Evicts (removes) the entity from the hibernate cache
|
Object |
find(int transform,
String contentIdentifier,
String repositoryIdentifier)
Does the same thing as
AttachmentDao.find(String, String) with an additional flag called
transform . |
Attachment |
find(String contentIdentifier,
String repositoryIdentifier)
Find a resource by the given identifiers
|
Attachment |
findContentTypeNull()
Find an attachments with an empty content type to be migrated
|
Note |
findNoteByContentId(ContentId contentId)
Finds the note by a given content id of an attachment.
|
protected GlobalIdDao |
getGlobalIdDao()
Gets the reference to
globalIdDao . |
protected abstract Attachment |
handleFindContentTypeNull()
Performs the core logic for
findContentTypeNull() |
protected abstract Note |
handleFindNoteByContentId(ContentId contentId)
Performs the core logic for
findNoteByContentId(com.communote.server.core.crc.vo.ContentId) |
Object |
load(int transform,
Long id)
Does the same thing as
AttachmentDao.load(Long) with an additional flag called
transform . |
Attachment |
load(Long id)
Loads an instance of Attachment from the persistent store.
|
Collection<Attachment> |
loadAll()
Loads all entities of type
Attachment . |
Collection<?> |
loadAll(int transform)
Does the same thing as
AttachmentDao.loadAll() with an additional flag called
transform . |
void |
remove(Attachment attachment)
Removes the instance of Attachment from the persistent store.
|
void |
remove(Collection<Attachment> attachments)
Removes all entities in the given
entities |
void |
remove(Long id)
Removes the instance of Attachment having the given
identifier from the
persistent store. |
void |
setGlobalIdDao(GlobalIdDao globalIdDao)
Sets the reference to
globalIdDao . |
protected void |
transformEntities(int transform,
Collection<?> entities)
Transforms a collection of entities using the
transformEntity(int,com.communote.server.model.attachment.Attachment) method. |
protected Object |
transformEntity(int transform,
Attachment entity)
Allows transformation of entities into value objects (or something else for that matter),
when the
transform flag is set to one of the constants defined in
com.communote.server.persistence.resource.AttachmentDao , please note that the
AttachmentDao.TRANSFORM_NONE constant denotes no transformation, so the entity itself will be
returned. |
void |
update(Attachment attachment)
Updates the
attachment instance in the persistent store. |
void |
update(Collection<Attachment> entities)
Updates all instances in the
entities collection in the persistent store. |
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findOrphanedAttachments
public Attachment create(Attachment attachment)
AttachmentDao
create
in interface AttachmentDao
AttachmentDao.create(com.communote.server.model.attachment.Attachment)
public Object create(int transform, Attachment attachment)
AttachmentDao
Does the same thing as AttachmentDao.create(Attachment)
with an additional flag called
transform
. If this flag is set to TRANSFORM_NONE
then the returned
entity will NOT be transformed. If this flag is any of the other constants
defined here then the result WILL BE passed through an operation which can
optionally transform the entity (into a value object for example). By default, transformation
does not occur.
create
in interface AttachmentDao
com.communote.server.persistence.resource.AttachmentDao#create(int transform,
com.communote.server.persistence.resource.Attachment)
public Collection<Attachment> create(int transform, Collection<Attachment> entities)
AttachmentDao
Does the same thing as AttachmentDao.create(Attachment)
with an additional flag called
transform
. If this flag is set to TRANSFORM_NONE
then the returned
entity will NOT be transformed. If this flag is any of the other constants
defined here then the result WILL BE passed through an operation which can
optionally transform the entities (into value objects for example). By default,
transformation does not occur.
create
in interface AttachmentDao
com.communote.server.persistence.resource.AttachmentDao#create(int,
java.util.Collection)
public Collection<Attachment> create(Collection<Attachment> entities)
AttachmentDao
entities
collectioncreate
in interface AttachmentDao
entities
- the collection of Attachment instances to create.AttachmentDao.create(java.util.Collection<
Attachment>)
public void evict(Attachment entity)
evict
in interface AttachmentDao
entity
- the entity to evictpublic Object find(int transform, String contentIdentifier, String repositoryIdentifier)
AttachmentDao
Does the same thing as AttachmentDao.find(String, String)
with an additional flag called
transform
. If this flag is set to TRANSFORM_NONE
then finder
results will NOT be transformed during retrieval. If this flag is any of the
other constants defined here then finder results WILL BE passed through an
operation which can optionally transform the entities (into value objects for example). By
default, transformation does not occur.
find
in interface AttachmentDao
AttachmentDao.find(int, String, String)
public Attachment find(String contentIdentifier, String repositoryIdentifier)
AttachmentDao
find
in interface AttachmentDao
AttachmentDao.find(String, String)
public Attachment findContentTypeNull()
AttachmentDao
findContentTypeNull
in interface AttachmentDao
AttachmentDao.findContentTypeNull()
public Note findNoteByContentId(ContentId contentId)
AttachmentDao
findNoteByContentId
in interface AttachmentDao
AttachmentDao.findNoteByContentId(com.communote.server.core.crc.vo.ContentId)
protected GlobalIdDao getGlobalIdDao()
globalIdDao
.protected abstract Attachment handleFindContentTypeNull()
findContentTypeNull()
protected abstract Note handleFindNoteByContentId(ContentId contentId)
findNoteByContentId(com.communote.server.core.crc.vo.ContentId)
public Object load(int transform, Long id)
AttachmentDao
Does the same thing as AttachmentDao.load(Long)
with an additional flag called
transform
. If this flag is set to TRANSFORM_NONE
then the returned
entity will NOT be transformed. If this flag is any of the other constants
defined in this class then the result WILL BE passed through an operation
which can optionally transform the entity (into a value object for example). By default,
transformation does not occur.
load
in interface AttachmentDao
id
- the identifier of the entity to load.AttachmentDao.load(int, Long)
public Attachment load(Long id)
AttachmentDao
load
in interface AttachmentDao
AttachmentDao.load(Long)
public Collection<Attachment> loadAll()
AttachmentDao
Attachment
.loadAll
in interface AttachmentDao
AttachmentDao.loadAll()
public Collection<?> loadAll(int transform)
AttachmentDao
Does the same thing as AttachmentDao.loadAll()
with an additional flag called
transform
. If this flag is set to TRANSFORM_NONE
then the returned
entity will NOT be transformed. If this flag is any of the other constants
defined here then the result WILL BE passed through an operation which can
optionally transform the entity (into a value object for example). By default, transformation
does not occur.
loadAll
in interface AttachmentDao
transform
- the flag indicating what transformation to use.AttachmentDao.loadAll(int)
public void remove(Collection<Attachment> attachments)
AttachmentDao
entities collection.
remove
in interface AttachmentDao
AttachmentDao.remove(java.util.Collection<
Attachment>)
public void remove(Attachment attachment)
AttachmentDao
remove
in interface AttachmentDao
AttachmentDao.remove(com.communote.server.model.attachment.Attachment)
public void remove(Long id)
AttachmentDao
identifier
from the
persistent store.remove
in interface AttachmentDao
AttachmentDao.remove(Long)
public void setGlobalIdDao(GlobalIdDao globalIdDao)
globalIdDao
.protected void transformEntities(int transform, Collection<?> entities)
transformEntity(int,com.communote.server.model.attachment.Attachment)
method. This
method does not instantiate a new collection.
This method is to be used internally only.transform
- one of the constants declared in
com.communote.server.persistence.resource.AttachmentDao
entities
- the collection of entities to transformtransformEntity(int,com.communote.server.model.attachment.Attachment)
protected Object transformEntity(int transform, Attachment entity)
transform
flag is set to one of the constants defined in
com.communote.server.persistence.resource.AttachmentDao
, please note that the
AttachmentDao.TRANSFORM_NONE
constant denotes no transformation, so the entity itself will be
returned.
If the integer argument value is unknown AttachmentDao.TRANSFORM_NONE
is assumed.transform
- one of the constants declared in
AttachmentDao
entity
- an entity that was foundtransformEntities(int,java.util.Collection)
public void update(Attachment attachment)
AttachmentDao
attachment
instance in the persistent store.update
in interface AttachmentDao
AttachmentDao.update(com.communote.server.model.attachment.Attachment)
public void update(Collection<Attachment> entities)
AttachmentDao
entities
collection in the persistent store.update
in interface AttachmentDao
AttachmentDao.update(java.util.Collection<
Attachment>)
Copyright © 2019 Communote team. All rights reserved.