Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.map
Class DerivedDbAttribute

    java.lang.Object
      org.apache.cayenne.map.Attribute
          org.apache.cayenne.map.DbAttribute
              org.apache.cayenne.map.DerivedDbAttribute

All Implemented Interfaces:
  Serializable, CayenneMapEntry, XMLSerializable

Deprecated. since 3.0M2 (scheduled for removal in 3.0M3) this type of mapping is no longer supported.

    public class DerivedDbAttribute

extends DbAttribute

A DerivedDbAttribute is a DbAttribute that resolves to an SQL expression based on a set of other attributes. DerivedDbAttribute's allow to build expressions like " `count(id)`", "`sum(price)`", etc.

Internally DerivedDbAttribute is defined as a specification string and a set of substitution DbAttribute parameters. Specification string is an SQL expression that contains placeholders (`%@`) for attribute parameters, for example:

`sum(%@) + sum(%@)`

Author:
  Andrus Adamchik
See Also:
  Serialized Form

Field Summary
`static String` | `ATTRIBUTE_TOKEN` Deprecated.
`protected String` | `expressionSpec` Deprecated.
`protected boolean` | `groupBy` Deprecated.
`protected List` | `params` Deprecated.

Fields inherited from class org.apache.cayenne.map.DbAttribute
`attributePrecision, generated, mandatory, maxLength, primaryKey, scale, type`

Fields inherited from class org.apache.cayenne.map.Attribute
`entity, name`

Constructor Summary
`DerivedDbAttribute()` Deprecated. Constructor for DerivedDbAttribute.
`DerivedDbAttribute(DbEntity entity, DbAttribute parentProto)` Deprecated. Creates and initializes a derived attribute with an attribute of a parent entity.
`DerivedDbAttribute(String name)` Deprecated. Constructor for DerivedDbAttribute.
`DerivedDbAttribute(String name, int type, DbEntity entity, String spec)` Deprecated. Constructor for DerivedDbAttribute.

Method Summary
`void` | `addParam(DbAttribute param)` Deprecated. Adds parameter.
`void` | `clearParams()` Deprecated.
`void` | `encodeAsXML(XMLEncoder encoder)` Deprecated. Prints itself as XML to the provided XMLEncoder.
`String` | `getAliasedName(String alias)` Deprecated.
`String` | `getExpressionSpec()` Deprecated. Returns the expressionSpec.
`List` | `getParams()` Deprecated. Returns the params.
`boolean` | `isGroupBy()` Deprecated. Returns true if this attribute is used in GROUP BY clause of the parent entity.
`void` | `removeParam(DbAttribute param)` Deprecated.
`void` | `setExpressionSpec(String expressionSpec)` Deprecated. Sets the expressionSpec.
`void` | `setGroupBy(boolean flag)` Deprecated.

Methods inherited from class org.apache.cayenne.map.DbAttribute
`getAttributePrecision, getMaxLength, getPrecision, getScale, getType, isForeignKey, isGenerated, isMandatory, isPrimaryKey, setAttributePrecision, setGenerated, setMandatory, setMaxLength, setPrecision, setPrimaryKey, setScale, setType`

Methods inherited from class org.apache.cayenne.map.Attribute
`getEntity, getName, getParent, setEntity, setName, setParent, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### ATTRIBUTE_TOKEN

    public static final String ATTRIBUTE_TOKEN

  Deprecated.
  See Also:
    Constant Field Values

### expressionSpec

    protected String expressionSpec

  Deprecated.

### params

    protected List params

  Deprecated.

### groupBy

    protected boolean groupBy

  Deprecated.

Constructor Detail

### DerivedDbAttribute

    public DerivedDbAttribute()

  Deprecated.
  Constructor for DerivedDbAttribute.

### DerivedDbAttribute

    public DerivedDbAttribute(String name)

  Deprecated.
  Constructor for DerivedDbAttribute.

### DerivedDbAttribute

    public DerivedDbAttribute(String name,
                              int type,
                              DbEntity entity,
                              String spec)

  Deprecated.
  Constructor for DerivedDbAttribute.

### DerivedDbAttribute

    public DerivedDbAttribute(DbEntity entity,
                              DbAttribute parentProto)

  Deprecated.
  Creates and initializes a derived attribute with an attribute of a parent entity.

Method Detail

### encodeAsXML

    public void encodeAsXML(XMLEncoder encoder)

  Deprecated.
  Prints itself as XML to the provided XMLEncoder.

  Specified by:
    `encodeAsXML` in interface `XMLSerializable`
  Overrides:
    `encodeAsXML` in class `DbAttribute`
  Since:
    1.1

### getAliasedName

    public String getAliasedName(String alias)

  Deprecated.
  Overrides:
    `getAliasedName` in class `DbAttribute`

### isGroupBy

    public boolean isGroupBy()

  Deprecated.
  Returns true if this attribute is used in GROUP BY clause of the parent entity.

### setGroupBy

    public void setGroupBy(boolean flag)

  Deprecated.

### getParams

    public List getParams()

  Deprecated.
  Returns the params.

  Returns:
    List

### getExpressionSpec

    public String getExpressionSpec()

  Deprecated.
  Returns the expressionSpec.

### addParam

    public void addParam(DbAttribute param)

  Deprecated.
  Adds parameter.

### removeParam

    public void removeParam(DbAttribute param)

  Deprecated.

### clearParams

    public void clearParams()

  Deprecated.

### setExpressionSpec

    public void setExpressionSpec(String expressionSpec)

  Deprecated.
  Sets the expressionSpec.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2007 Apache Cayenne. All Rights Reserved.