All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javax.jcr.query.Row Maven / Gradle / Ivy

There is a newer version: 2024.9.17689.20240905T073330Z-240800
Show newest version
/*
 * Copyright 2009 Day Management AG, Switzerland. All rights reserved.
 */
package javax.jcr.query;

import javax.jcr.ItemNotFoundException;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.Value;

/**
 * A row in the query result table.
 */
public interface Row {

    /**
     * Returns an array of all the values in the same order as the column names
     * returned by {@link QueryResult#getColumnNames()}.
     *
     * @return a Value array.
     * @throws RepositoryException if an error occurs
     */
    public Value[] getValues() throws RepositoryException;

    /**
     * Returns the value of the indicated column in this Row.
     *
     * @param columnName name of query result table column
     * @return a Value
     * @throws ItemNotFoundException if columnName is not among the
     *                               column names of the query result table.
     * @throws RepositoryException   if another error occurs.
     */
    public Value getValue(String columnName) throws ItemNotFoundException, RepositoryException;

    /**
     * Returns the Node corresponding to this Row.
     *
     * @return a Node
     * @throws RepositoryException if this query has more than one selector (and
     *                             therefore, this Row corresponds to more than one
     *                             Node) or if another error occurs.
     * @since JCR 2.0
     */
    public Node getNode() throws RepositoryException;

    /**
     * Returns the Node corresponding to this Row and
     * the specified selector. If this Row is from a result
     * involving outer joins, it may have no Node corresponding to
     * the specified selector. In such a case this method returns
     * null.
     *
     * @param selectorName a String
     * @return a Node
     * @throws RepositoryException if selectorName is not the alias
     *                             of a selector in this query or if another error occurs.
     * @since JCR 2.0
     */
    public Node getNode(String selectorName) throws RepositoryException;

    /**
     * Equivalent to Row.getNode().getPath(). However, some
     * implementations may be able gain efficiency by not resolving the actual
     * Node.
     *
     * @return a String
     * @throws RepositoryException if this query has more than one selector (and
     *                             therefore, this Row corresponds to more than one
     *                             Node) or if another error occurs.
     * @since JCR 2.0
     */
    public String getPath() throws RepositoryException;

    /**
     * Equivalent to Row.getNode(selectorName).getPath(). However,
     * some implementations may be able gain efficiency by not resolving the
     * actual Node. If this Row is from a result
     * involving outer joins, it may have no Node corresponding to
     * the specified selector. In such a case this method returns
     * null.
     *
     * @param selectorName a String
     * @return a String
     * @throws RepositoryException if selectorName is not the alias
     *                             of a selector in this query or if another error occurs.
     * @since JCR 2.0
     */
    public String getPath(String selectorName) throws RepositoryException;

    /**
     * Returns the full text search score for this row associated with the
     * default selector. This corresponds to the score of a particular node.
     * 

* If no FullTextSearchScore AQM object is associated with the * default selector this method will still return a value. However, in that * case the returned value may not be meaningful or may simply reflect the * minimum possible relevance level (for example, in some systems this might * be a score of 0). *

* Note, in JCR-SQL2 a FullTextSearchScore AQM object is * represented by a SCORE() function. In JCR-JQOM it is * represented by a Java object of type javax.jcr.query.qom.FullTextSearchScore. * * @return a double * @throws RepositoryException if this query has more than one selector (and * therefore, this Row corresponds to more than one * Node) or if another error occurs. * @since JCR 2.0 */ public double getScore() throws RepositoryException; /** * Returns the full text search score for this row associated with the * specified selector. This corresponds to the score of a particular node. *

* If no FullTextSearchScore AQM object is associated with the * selector selectorName this method will still return a value. * However, in that case the returned value may not be meaningful or may * simply reflect the minimum possible relevance level (for example, in some * systems this might be a score of 0). *

* Note, in JCR-SQL2 a FullTextSearchScore AQM object is * represented by a SCORE() function. In JCR-JQOM it is * represented by a Java object of type javax.jcr.query.qom.FullTextSearchScore. *

* If this Row is from a result involving outer joins, it may * have no Node corresponding to the specified selector. In * such a case this method returns an implementation selected value, as it * would if there were no FullTextSearchScore associated with * the selector. * * @param selectorName a String * @return a double * @throws RepositoryException if selectorName is not the alias * of a selector in this query or if another error occurs. * @since JCR 2.0 */ public double getScore(String selectorName) throws RepositoryException; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy