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 Details

    • MetadataSchemaDAOImpl

      protected MetadataSchemaDAOImpl()
  • Method Details

    • findByNamespace

      public MetadataSchema findByNamespace(Context context, String namespace) throws SQLException
      Get the schema object corresponding to this namespace URI.
      Specified by:
      findByNamespace in interface MetadataSchemaDAO
      Parameters:
      context - DSpace context
      namespace - 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: GenericDAO
      Fetch all persisted instances of a given object type.
      Specified by:
      findAll in interface GenericDAO<MetadataSchema>
      Overrides:
      findAll in class AbstractHibernateDAO<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:
      uniqueNamespace in interface MetadataSchemaDAO
      Parameters:
      context - DSpace context
      metadataSchemaId - schema id
      namespace - 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:
      uniqueShortName in interface MetadataSchemaDAO
      Parameters:
      context - DSpace context
      metadataSchemaId - schema id
      name - 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:
      find in interface MetadataSchemaDAO
      Parameters:
      context - context, in case we need to read it in from DB
      shortName - the short name for the schema
      Returns:
      the metadata schema object
      Throws:
      SQLException - if database error