Class SQLSession

    • Method Detail

      • getReadColumns

        protected List<Column> getReadColumns()
      • getReadColumnsSQL

        protected String getReadColumnsSQL()
      • getIdColumn

        protected Column getIdColumn()
      • checkConcurrentUpdate

        protected void checkConcurrentUpdate​(Throwable e)
                                      throws ConcurrentUpdateException
        Checks the SQL error we got and determine if a concurrent update happened. Throws if that's the case.
        Parameters:
        e - the exception
        Throws:
        ConcurrentUpdateException
        Since:
        7.10-HF04, 8.2
      • addFilterWhereClause

        protected String addFilterWhereClause​(String whereClause)
      • addFilterValues

        protected void addFilterValues​(PreparedStatement ps,
                                       int startIdx)
      • addFilterValuesForLog

        protected void addFilterValuesForLog​(List<Serializable> values)
      • getPassword

        protected String getPassword​(String id)
        Internal method to read the hashed password for authentication.
        Since:
        9.1
      • deleteEntry

        public void deleteEntry​(String id)
        Description copied from interface: Session
        Deletes a directory entry by id.
        Specified by:
        deleteEntry in interface Session
        Overrides:
        deleteEntry in class BaseSession
        Parameters:
        id - the id of the entry to delete
      • deleteEntry

        public void deleteEntry​(String id,
                                Map<String,​String> map)
        Description copied from interface: Session
        Deletes a directory entry by id and secondary ids.

        This is used for hierarchical vocabularies, where the actual unique key is the couple (parent, id).

        Specified by:
        deleteEntry in interface Session
        Overrides:
        deleteEntry in class BaseSession
        Parameters:
        id - the id of the entry to delete.
        map - a map of secondary key values.
      • query

        public DocumentModelList query​(Map<String,​Serializable> filter,
                                       Set<String> fulltext,
                                       Map<String,​String> orderBy,
                                       boolean fetchReferences,
                                       int limit,
                                       int offset)
        Description copied from interface: Session
        Executes a query with the possibility to fetch a subset of the results. org.nuxeo.ecm.directory.BaseSession provides a default implementation fetching all results to return the subset. Not recommended.
        limit - maximum number of results ignored if less than 1
        offset - number of rows skipped before starting, will be 0 if less than 0.
        See Also:
        Session.query(Map, Set, Map, boolean)
      • query

        public DocumentModelList query​(QueryBuilder queryBuilder,
                                       boolean fetchReferences)
        Description copied from interface: Session
        Executes a query with the possibility to fetch a subset of the results.
        Parameters:
        queryBuilder - the query to use, including limit, offset, ordering and countTotal
        fetchReferences - boolean stating if references have to be fetched
        Returns:
        the list of documents, where the total size may be present if countTotal was true
      • queryIds

        public List<String> queryIds​(QueryBuilder queryBuilder)
        Description copied from interface: Session
        Executes a query with the possibility to fetch a subset of the results. Returns the matching ids.
        Parameters:
        queryBuilder - the query to use, including limit, offset and ordering
        Returns:
        the list of document ids
      • close

        public void close()
        Description copied from interface: Session
        Closes the session and all open result sets obtained from this session.

        Releases this Connection object's resources immediately instead of waiting for them to be automatically released.

        TODO: should this operation auto-commit pending changes?

      • isLive

        public boolean isLive()
        Enable connection status checking on SQL directory connections
        Since:
        5.7.2
      • authenticate

        public boolean authenticate​(String username,
                                    String password)
        Description copied from interface: Session
        Checks that the credentials provided by the UserManager match those registered in the directory. If username is not in the directory, this should return false instead of throrwing an exception.
        Returns:
        true is the credentials match those stored in the directory
      • isAuthenticating

        public boolean isAuthenticating()
        Description copied from interface: Session
        Tells whether the directory implementation can be used as an authenticating backend for the UserManager (based on login / password check).
        Specified by:
        isAuthenticating in interface Session
        Overrides:
        isAuthenticating in class BaseSession
        Returns:
        true is the directory is authentication aware
      • hasEntry

        public boolean hasEntry​(String id)
        Description copied from interface: Session
        Returns true if session has an entry with given id.