Package org.dspace.content.dao.impl
Class MetadataSchemaDAOImpl
- java.lang.Object
-
- org.dspace.core.AbstractHibernateDAO<MetadataSchema>
-
- org.dspace.content.dao.impl.MetadataSchemaDAOImpl
-
- All Implemented Interfaces:
MetadataSchemaDAO,GenericDAO<MetadataSchema>
public class MetadataSchemaDAOImpl extends AbstractHibernateDAO<MetadataSchema> implements MetadataSchemaDAO
Hibernate implementation of the Database Access Object interface class for the MetadataSchema object. This class is responsible for all database calls for the MetadataSchema object and is autowired by spring This class should never be accessed directly.- Author:
- kevinvandevelde at atmire.com
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMetadataSchemaDAOImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetadataSchemafind(Context context, String shortName)Get the schema corresponding with this short name.List<MetadataSchema>findAll(Context context, Class clazz)Fetch all persisted instances of a given object type.MetadataSchemafindByNamespace(Context context, String namespace)Get the schema object corresponding to this namespace URI.booleanuniqueNamespace(Context context, int metadataSchemaId, String namespace)Return true if and only if the passed name appears within the allowed number of times in the current schema.booleanuniqueShortName(Context context, int metadataSchemaId, String name)Return true if and only if the passed name is unique.-
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, 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
-
findByNamespace
public MetadataSchema findByNamespace(Context context, String namespace) throws SQLException
Get the schema object corresponding to this namespace URI.- Specified by:
findByNamespacein interfaceMetadataSchemaDAO- Parameters:
context- DSpace contextnamespace- namespace URI to match- Returns:
- metadata schema object or null if none found.
- Throws:
SQLException- if database error
-
findAll
public List<MetadataSchema> findAll(Context context, Class clazz) throws SQLException
Description copied from interface:GenericDAOFetch all persisted instances of a given object type.- Specified by:
findAllin interfaceGenericDAO<MetadataSchema>- Overrides:
findAllin classAbstractHibernateDAO<MetadataSchema>- 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
-
uniqueNamespace
public boolean uniqueNamespace(Context context, int metadataSchemaId, String namespace) throws SQLException
Return true if and only if the passed name appears within the allowed number of times in the current schema.- Specified by:
uniqueNamespacein interfaceMetadataSchemaDAO- Parameters:
context- DSpace contextmetadataSchemaId- schema idnamespace- namespace URI to match- Returns:
- true of false
- Throws:
SQLException- if database error
-
uniqueShortName
public boolean uniqueShortName(Context context, int metadataSchemaId, String name) throws SQLException
Return true if and only if the passed name is unique.- Specified by:
uniqueShortNamein interfaceMetadataSchemaDAO- Parameters:
context- DSpace contextmetadataSchemaId- schema idname- short name of schema- Returns:
- true of false
- Throws:
SQLException- if database error
-
find
public MetadataSchema find(Context context, String shortName) throws SQLException
Get the schema corresponding with this short name.- Specified by:
findin interfaceMetadataSchemaDAO- Parameters:
context- context, in case we need to read it in from DBshortName- the short name for the schema- Returns:
- the metadata schema object
- Throws:
SQLException- if database error
-
-