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 -
Method Summary
Modifier and TypeMethodDescriptionGet the schema corresponding with this short name.Fetch all persisted instances of a given object type.findByNamespace(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, createQuery, delete, executeCriteriaQuery, findAll, findByID, findByID, findByID, findByX, findMany, findMany, findUnique, getCriteriaBuilder, getCriteriaQuery, getHibernateSession, iterate, list, list, list, list, save, singleResult, singleResult, uniqueResult, uniqueResultMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.dspace.core.GenericDAO
create, delete, findAll, findByID, findByID, findByID, findMany, findUnique, save
-
Constructor Details
-
MetadataSchemaDAOImpl
protected MetadataSchemaDAOImpl()
-
-
Method Details
-
findByNamespace
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
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
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
-