SelfProperty (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne.exp.property, class: SelfProperty

# Class SelfProperty<E extends Persistent>

java.lang.Object
org.apache.cayenne.exp.property.BaseProperty<E>
org.apache.cayenne.exp.property.EntityProperty<E>
org.apache.cayenne.exp.property.SelfProperty<E>

Type Parameters:
  `E` - type of the property

All Implemented Interfaces:
  `PathProperty<E>, Property<E>, RelationshipProperty<E>`

public class SelfProperty<E extends Persistent> extends EntityProperty<E>
Property that represents root entity

Usage example: ``

    List<Object[]> result = Artist.SELF
        .columnQuery(Artist.SELF, Artist.PAINTING_ARRAY.count())
        .select(context);

Since:
  5.0

- ## Field Summary

  ### Fields inherited from class BaseProperty

  `expressionSupplier, path, type`
  Modifier and Type
  Field
  Description
  `protected final Supplier<Expression>`
  `expressionSupplier`
  Expression provider for the property
  `protected final CayennePath`
  `path`
  Path of this property
  `protected final Class<E>`
  `type`
  Explicit type of the property

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `SelfProperty(CayennePath path, Expression expression, Class<E> type)`
  Constructs a new property with the given name and expression

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ColumnSelect<Object[]>`
  `columnQuery(Property<?>... properties)`
  `<T> ColumnSelect<T>`
  `columnQuery(Property<T> property)`
  `Expression`
  `exists(Expression where)`
  `Expression`
  `notExists(Expression where)`
  `ObjectSelect<E>`
  `query()`
  `ObjectSelect<E>`
  `query(Expression where)`

  ### Methods inherited from class EntityProperty

  `alias, enclosing, eqId, idsIn, idsInCollection, idsNotIn, idsNotInCollection, inId, inId, neqId, ninId, ninId, outer`
  Modifier and Type
  Method
  Description
  `EntityProperty<E>`
  `alias(String alias)`
  Creates alias with different name for this property
  `EntityProperty<E>`
  `enclosing()`
  This operator allows to access properties of the enclosing query from the subquery.
  `Expression`
  `eqId(Object id)`
  `Expression`
  `idsIn(Object... ids)`
  `Expression`
  `idsInCollection(Collection<?> ids)`
  `Expression`
  `idsNotIn(Object... ids)`
  `Expression`
  `idsNotInCollection(Collection<?> ids)`
  `Expression`
  `inId(Object firstId, Object... moreIds)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  since 5.0 in favour of `EntityProperty.idsIn(Object...)`
  `Expression`
  `inId(Collection<Object> ids)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  since 5.0 in favour of `EntityProperty.idsInCollection(Collection)`
  `Expression`
  `neqId(Object id)`
  `Expression`
  `ninId(Object firstId, Object... moreIds)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  since 5.0 in favour of `EntityProperty.idsNotIn(Object...)`
  `Expression`
  `ninId(Collection<Object> ids)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  since 5.0 in favour of `EntityProperty.idsNotInCollection(Collection)`
  `EntityProperty<E>`
  `outer()`
  Returns a version of this property that represents an OUTER join.

  ### Methods inherited from class BaseProperty

  `aggregate, asc, ascInsensitive, ascInsensitives, ascs, count, countDistinct, desc, descInsensitive, descInsensitives, descs, eq, eq, equals, function, function, getAlias, getExpression, getFrom, getFromAll, getName, getPath, getType, hashCode, in, in, in, isFalse, isNotNull, isNull, isTrue, ne, ne, nin, nin, nin, operator, operator, setIn, setInAll`
  Modifier and Type
  Method
  Description
  `<T> BaseProperty<T>`
  `aggregate(String function, Class<T> type)`
  `Ordering`
  `asc()`
  `Ordering`
  `ascInsensitive()`
  `Orderings`
  `ascInsensitives()`
  `Orderings`
  `ascs()`
  `NumericProperty<Long>`
  `count()`
  `NumericProperty<Long>`
  `countDistinct()`
  `Ordering`
  `desc()`
  `Ordering`
  `descInsensitive()`
  `Orderings`
  `descInsensitives()`
  `Orderings`
  `descs()`
  `Expression`
  `eq(E value)`
  `Expression`
  `eq(BaseProperty<?> value)`
  `boolean`
  `equals(Object o)`
  `<T> BaseProperty<T>`
  `function(String functionName, Class<T> returnType, Object... arguments)`
  `<T> BaseProperty<T>`
  `function(String functionName, Class<T> returnType, BaseProperty<?>... arguments)`
  `String`
  `getAlias()`
  `Expression`
  `getExpression()`
  This method returns fresh copy of the expression for each call.
  `E`
  `getFrom(Object bean)`
  Extracts property value from an object using JavaBean-compatible introspection with one addition - a property can be a dot-separated property name path.
  `List<E>`
  `getFromAll(Collection<?> beans)`
  Extracts property value from a collection of objects using JavaBean-compatible introspection with one addition - a property can be a dot-separated property name path.
  `String`
  `getName()`
  `CayennePath`
  `getPath()`
  `Class<E>`
  `getType()`
  `int`
  `hashCode()`
  `Expression`
  `in(E firstValue, E... moreValues)`
  `Expression`
  `in(Collection<E> values)`
  `Expression`
  `in(ColumnSelect<? extends E> subquery)`
  `Expression`
  `isFalse()`
  `Expression`
  `isNotNull()`
  `Expression`
  `isNull()`
  `Expression`
  `isTrue()`
  `Expression`
  `ne(E value)`
  `Expression`
  `ne(BaseProperty<?> value)`
  `Expression`
  `nin(E firstValue, E... moreValues)`
  `Expression`
  `nin(Collection<E> values)`
  `Expression`
  `nin(ColumnSelect<? extends E> subquery)`
  `<T> BaseProperty<T>`
  `operator(String operator, Class<T> returnType, Object... arguments)`
  `<T> BaseProperty<T>`
  `operator(String operator, Class<T> returnType, BaseProperty<?>... arguments)`
  `void`
  `setIn(Object bean, E value)`
  Sets a property value in 'obj' using JavaBean-compatible introspection with one addition - a property can be a dot-separated property name path.
  `void`
  `setInAll(Collection<?> beans, E value)`
  Sets a property value in a collection of objects using JavaBean-compatible introspection with one addition - a property can be a dot-separated property name path.

  ### Methods inherited from class Object

  `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface PathProperty

  `dot, dot, dot, dot, dot`
  Modifier and Type
  Method
  Description
  `default BaseProperty<Object>`
  `dot(String property)`
  Constructs a property path by appending the argument to the existing property separated by a dot.
  `default <T> BaseProperty<T>`
  `dot(BaseProperty<T> property)`
  Constructs a new property path by appending the argument to the existing property separated by a dot.
  `default <T> DateProperty<T>`
  `dot(DateProperty<T> property)`
  Constructs a new property path by appending the argument to the existing property separated by a dot.
  `default <T extends Number>
  NumericProperty<T>`
  `dot(NumericProperty<T> property)`
  Constructs a new property path by appending the argument to the existing property separated by a dot.
  `default <T extends CharSequence>
  StringProperty<T>`
  `dot(StringProperty<T> property)`
  Constructs a new property path by appending the argument to the existing property separated by a dot.

  ### Methods inherited from interface RelationshipProperty

  `disjoint, disjointById, dot, dot, dot, dot, dot, dot, dot, exists, joint, notExists`
  Modifier and Type
  Method
  Description
  `default PrefetchTreeNode`
  `disjoint()`
  Returns a prefetch tree that follows this property path, potentially spanning a number of phantom nodes, and having a single leaf with "disjoint" prefetch semantics.
  `default PrefetchTreeNode`
  `disjointById()`
  Returns a prefetch tree that follows this property path, potentially spanning a number of phantom nodes, and having a single leaf with "disjoint by id" prefetch semantics.
  `default <T> BaseIdProperty<T>`
  `dot(BaseIdProperty<T> property)`
  Constructs a new property path by appending the argument to the existing property separated by a dot.
  `default <T extends EmbeddableObject>
  EmbeddableProperty<T>`
  `dot(EmbeddableProperty<T> property)`
  Constructs a new property path by appending the argument to the existing property separated by a dot.
  `default <T extends Persistent>
  EntityProperty<T>`
  `dot(EntityProperty<T> property)`
  Constructs a new property path by appending the argument to the existing property separated by a dot.
  `default <T extends Persistent>
  ListProperty<T>`
  `dot(ListProperty<T> property)`
  Constructs a new property path by appending the argument to the existing property separated by a dot.
  `default <K, V extends Persistent>
  MapProperty<K,V>`
  `dot(MapProperty<K,V> property)`
  Constructs a new property path by appending the argument to the existing property separated by a dot.
  `default <T extends Number>
  NumericIdProperty<T>`
  `dot(NumericIdProperty<T> property)`
  Constructs a new property path by appending the argument to the existing property separated by a dot.
  `default <T extends Persistent>
  SetProperty<T>`
  `dot(SetProperty<T> property)`
  Constructs a new property path by appending the argument to the existing property separated by a dot.
  `default Expression`
  `exists()`
  `default PrefetchTreeNode`
  `joint()`
  Returns a prefetch tree that follows this property path, potentially spanning a number of phantom nodes, and having a single leaf with "joint" prefetch semantics.
  `default Expression`
  `notExists()`

- ## Constructor Details

  - ### SelfProperty

    protected SelfProperty(CayennePath path, Expression expression, Class<E> type)
    Constructs a new property with the given name and expression
    Parameters:
      `path` - of the property (will be used as alias for the expression)
      `expression` - expression for property
      `type` - of the property
    See Also:
      - `PropertyFactory.createBase(String, Expression, Class)`

- ## Method Details

  - ### exists

    public Expression exists(Expression where)

  - ### notExists

    public Expression notExists(Expression where)

  - ### query

    public ObjectSelect<E> query(Expression where)

  - ### query

    public ObjectSelect<E> query()

  - ### columnQuery

    public <T> ColumnSelect<T> columnQuery(Property<T> property)

  - ### columnQuery

    public ColumnSelect<Object[]> columnQuery(Property<?>... properties)