Class EmbeddedFunctions

  • Direct Known Subclasses:
    H2Functions

    public class EmbeddedFunctions
    extends Object
    Functions used as stored procedures for H2.
    Author:
    Florent Guillaume
    • Constructor Detail

      • EmbeddedFunctions

        public EmbeddedFunctions()
    • Method Detail

      • isInTree

        public static boolean isInTree​(Serializable id,
                                       Serializable baseId)
                                throws SQLException
        Checks if an id is a (strict) descendant of a given base id.
        Parameters:
        id - the id to check for
        baseId - the base id
        Throws:
        SQLException
      • isInTree

        public static boolean isInTree​(Connection conn,
                                       Serializable id,
                                       Serializable baseId)
                                throws SQLException
        Checks if an id is a (strict) descendant of a given base id.
        Parameters:
        conn - the connection to the database
        id - the id to check for
        baseId - the base id
        Throws:
        SQLException
      • isAccessAllowed

        @Deprecated
        public static boolean isAccessAllowed​(Serializable id,
                                              Set<String> principals,
                                              Set<String> permissions)
                                       throws SQLException
        Deprecated.
        since 11.3, unused
        Checks if access to a document is allowed.

        This implements in SQL the ACL-based security policy logic.

        Parameters:
        id - the id of the document
        principals - the allowed identities
        permissions - the allowed permissions
        Throws:
        SQLException
      • isAccessAllowed

        public static boolean isAccessAllowed​(Connection conn,
                                              Serializable id,
                                              Set<String> principals,
                                              Set<String> permissions,
                                              boolean disableVersionACL,
                                              boolean disableReadVersionPermission)
                                       throws SQLException
        Checks if access to a document is allowed.

        This implements in SQL the ACL-based security policy logic.

        Parameters:
        conn - the database connection
        id - the id of the document
        principals - the allowed identities
        permissions - the allowed permissions
        disableVersionACL - whether ACLs on a version are disabled
        disableReadVersionPermission - whether the ReadVersion permission is disabled
        Throws:
        SQLException
        Since:
        11.3
      • parseFullText

        @Deprecated(since="11.1")
        public static String parseFullText​(String string1,
                                           String string2)
        Deprecated.
        unused
        Extracts the words from a string for simple fulltext indexing.
        Parameters:
        string1 - the first string
        string2 - the second string
        Returns:
        a string with extracted words
      • matchesFullText

        @Deprecated(since="11.1")
        protected static boolean matchesFullText​(String fulltext,
                                                 String query)
        Deprecated.
        unused
        Checks if the passed query expression matches the fulltext.
        Parameters:
        fulltext - the fulltext, space-separated words
        query - a list of space-separated words
        Returns:
        true if all the words are in the fulltext