Class ExtendedFieldDAO

  • All Implemented Interfaces:
    DAO
    Direct Known Subclasses:
    ExtendedFieldDBDAO

    public abstract class ExtendedFieldDAO
    extends Object
    implements DAO
    Interface for creating and accessing extended fields in persistent storage.
    • Field Detail

      • instance

        protected static ExtendedFieldDAO instance
        The database singleton model.
    • Constructor Detail

      • ExtendedFieldDAO

        protected ExtendedFieldDAO()
        constructor used when creating singleton. Do not call directly.
    • Method Detail

      • reset

        public static void reset()
        Reset the DAO instance. Only for use from within tests.
      • exists

        public abstract boolean exists​(Long aExtendedfieldId)
        Check if an extendedfield exists for a given ID.
        Parameters:
        aExtendedfieldId - a given ID.
        Returns:
        true, if an extendedfield exists for the given ID
      • create

        public abstract void create​(ExtendedField aExtendedField)
        Creates an instance in persistent storage of the given extended Field.
        Parameters:
        aExtendedField - a ExtendedField to create in persistent storage.
      • read

        public abstract ExtendedField read​(Long aExtendedFieldID)
                                    throws ArgumentNotValid,
                                           UnknownID,
                                           IOFailure
        Reads an ExtendedField from persistent storage.
        Parameters:
        aExtendedFieldID - The ID of the ExtendedField to read
        Returns:
        a ExtendedField instance
        Throws:
        ArgumentNotValid - If failed to create ExtendedField instance in case aExtendedFieldID is invalid
        UnknownID - If the job with the given jobID does not exist in persistent storage.
        IOFailure - If the loaded ID of ExtendedField does not match the expected.
      • update

        public abstract void update​(ExtendedField aExtendedField)
                             throws IOFailure
        Update a ExtendedField in persistent storage.
        Parameters:
        aExtendedField - The ExtendedField to update
        Throws:
        IOFailure - If writing the ExtendedField to persistent storage fails
      • getAll

        public abstract List<ExtendedField> getAll​(long aExtendedFieldTypeId)
        Return a list of all ExtendedFields of the given Extended Field Type.
        Parameters:
        aExtendedFieldTypeId - extended field type.
        Returns:
        A list of all ExtendedFields with given Extended Field Type
      • delete

        public abstract void delete​(long aExtendedFieldID)
                             throws IOFailure
        deletes an ExtendedField from persistent storage. The implementation of this method must also delete all belonging extended field values.
        Parameters:
        aExtendedFieldID - The ID of the ExtendedField to read
        Throws:
        IOFailure - If deleting the ExtendedField fails
      • getInstance

        public static ExtendedFieldDAO getInstance()
        Returns:
        an instance of this class.