Package org.dspace.content.dao.impl
Class BitstreamFormatDAOImpl
- java.lang.Object
-
- org.dspace.core.AbstractHibernateDAO<BitstreamFormat>
-
- org.dspace.content.dao.impl.BitstreamFormatDAOImpl
-
- All Implemented Interfaces:
BitstreamFormatDAO,GenericDAO<BitstreamFormat>
public class BitstreamFormatDAOImpl extends AbstractHibernateDAO<BitstreamFormat> implements BitstreamFormatDAO
Hibernate implementation of the Database Access Object interface class for the BitstreamFormat object. This class is responsible for all database calls for the BitstreamFormat object and is autowired by Spring. This class should never be accessed directly.- Author:
- kevinvandevelde at atmire.com
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBitstreamFormatDAOImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<BitstreamFormat>findAll(Context context, Class clazz)Fetch all persisted instances of a given object type.List<BitstreamFormat>findByFileExtension(Context context, String extension)BitstreamFormatfindByMIMEType(Context context, String mimeType, boolean includeInternal)Find a bitstream format by its (unique) MIME type.BitstreamFormatfindByShortDescription(Context context, String desc)Find a bitstream format by its (unique) short descriptionList<BitstreamFormat>findNonInternal(Context context)intupdateRemovedBitstreamFormat(Context context, BitstreamFormat deletedBitstreamFormat, BitstreamFormat newBitstreamFormat)-
Methods inherited from class org.dspace.core.AbstractHibernateDAO
count, count, countLong, create, createQuery, delete, executeCriteriaQuery, findAll, findByID, findByID, findByX, findMany, findMany, findUnique, getCriteriaBuilder, getCriteriaQuery, getHibernateSession, iterate, list, list, list, list, save, singleResult, singleResult, uniqueResult, uniqueResult
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.dspace.core.GenericDAO
create, delete, findAll, findByID, findByID, findMany, findUnique, save
-
-
-
-
Method Detail
-
findByMIMEType
public BitstreamFormat findByMIMEType(Context context, String mimeType, boolean includeInternal) throws SQLException
Find a bitstream format by its (unique) MIME type. If more than one bitstream format has the same MIME type, the one returned is unpredictable.- Specified by:
findByMIMETypein interfaceBitstreamFormatDAO- Parameters:
context- DSpace context objectmimeType- MIME type valueincludeInternal- whether to include internal mimetypes- Returns:
- the corresponding bitstream format, or
nullif there's no bitstream format with the given MIMEtype. - Throws:
SQLException- if database error
-
findByShortDescription
public BitstreamFormat findByShortDescription(Context context, String desc) throws SQLException
Find a bitstream format by its (unique) short description- Specified by:
findByShortDescriptionin interfaceBitstreamFormatDAO- Parameters:
context- DSpace context objectdesc- the short description- Returns:
- the corresponding bitstream format, or
nullif there's no bitstream format with the given short description - Throws:
SQLException- if database error
-
updateRemovedBitstreamFormat
public int updateRemovedBitstreamFormat(Context context, BitstreamFormat deletedBitstreamFormat, BitstreamFormat newBitstreamFormat) throws SQLException
- Specified by:
updateRemovedBitstreamFormatin interfaceBitstreamFormatDAO- Throws:
SQLException
-
findNonInternal
public List<BitstreamFormat> findNonInternal(Context context) throws SQLException
- Specified by:
findNonInternalin interfaceBitstreamFormatDAO- Throws:
SQLException
-
findByFileExtension
public List<BitstreamFormat> findByFileExtension(Context context, String extension) throws SQLException
- Specified by:
findByFileExtensionin interfaceBitstreamFormatDAO- Throws:
SQLException
-
findAll
public List<BitstreamFormat> findAll(Context context, Class clazz) throws SQLException
Description copied from interface:GenericDAOFetch all persisted instances of a given object type.- Specified by:
findAllin interfaceGenericDAO<BitstreamFormat>- Overrides:
findAllin classAbstractHibernateDAO<BitstreamFormat>- Parameters:
context- The relevant DSpace Context.clazz- the desired type.- Returns:
- list of DAOs of the same type as clazz
- Throws:
SQLException- if database error
-
-