Interface MimetypeDAO

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      org.alfresco.util.Pair<java.lang.Long,​java.lang.String> getMimetype​(java.lang.Long id)  
      org.alfresco.util.Pair<java.lang.Long,​java.lang.String> getMimetype​(java.lang.String mimetype)  
      org.alfresco.util.Pair<java.lang.Long,​java.lang.String> getOrCreateMimetype​(java.lang.String mimetype)
      Retrieve an existing mimetype or create a new one if it doesn't exist.
      int updateMimetype​(java.lang.String oldMimetype, java.lang.String newMimetype)
      Update a mimetype if it exists.
    • Method Detail

      • getMimetype

        org.alfresco.util.Pair<java.lang.Long,​java.lang.String> getMimetype​(java.lang.Long id)
        Parameters:
        id - the unique ID of the entity
        Returns:
        the Mimetype pair (id, mimetype) (never null)
        Throws:
        org.alfresco.error.AlfrescoRuntimeException - if the ID provided is invalid
      • getMimetype

        org.alfresco.util.Pair<java.lang.Long,​java.lang.String> getMimetype​(java.lang.String mimetype)
        Parameters:
        mimetype - the Mimetype to query for
        Returns:
        the Mimetype pair (id, mimetype) or null if it doesn't exist
      • getOrCreateMimetype

        org.alfresco.util.Pair<java.lang.Long,​java.lang.String> getOrCreateMimetype​(java.lang.String mimetype)
        Retrieve an existing mimetype or create a new one if it doesn't exist.
        Parameters:
        mimetype - the Mimetype
        Returns:
        the Mimetype pair (id, mimetype) (never null)
      • updateMimetype

        int updateMimetype​(java.lang.String oldMimetype,
                           java.lang.String newMimetype)
        Update a mimetype if it exists. This method does not do any conflict resolution i.e. it will only succeed if the new mimetype does not exist already. Higher-level logic is required to handle updates to dependent rows, etc.
        Parameters:
        oldMimetype - the old Mimetype
        newMimetype - the new Mimetype
        Returns:
        the number of rows modified