Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.objectstyle.cayenne.map
Class DerivedDbEntity  view DerivedDbEntity download DerivedDbEntity.java

java.lang.Object
  extended byorg.objectstyle.cayenne.map.MapObject
      extended byorg.objectstyle.cayenne.map.Entity
          extended byorg.objectstyle.cayenne.map.DbEntity
              extended byorg.objectstyle.cayenne.map.DerivedDbEntity
All Implemented Interfaces:
org.objectstyle.cayenne.util.CayenneMapEntry, org.objectstyle.cayenne.map.event.DbAttributeListener, java.util.EventListener

public class DerivedDbEntity
extends DbEntity

DbEntity subclass that is based on another DbEntity and allows to define complex database expressions like GROUP BY and aggregate functions.


Nested Class Summary
 
Nested classes inherited from class org.objectstyle.cayenne.map.Entity
Entity.PathIterator
 
Field Summary
protected  java.lang.String parentEntityName
           
 
Fields inherited from class org.objectstyle.cayenne.map.DbEntity
catalog, primaryKey, primaryKeyGenerator, primaryKeyRef, schema
 
Fields inherited from class org.objectstyle.cayenne.map.Entity
attributes, attributesMapRef, attributesRef, PATH_SEPARATOR, queries, relationships, relationshipsRef
 
Fields inherited from class org.objectstyle.cayenne.map.MapObject
objName, objParent
 
Constructor Summary
DerivedDbEntity()
          Constructor for DerivedDbEntity.
DerivedDbEntity(java.lang.String name)
          Constructor for DerivedDbEntity.
DerivedDbEntity(java.lang.String name, DbEntity parentEntity)
          Constructor for DerivedDbEntity.
 
Method Summary
 java.lang.String getCatalog()
          Returns catalog of the parent entity.
 java.lang.String getFullyQualifiedName()
          Returns table name including schema, if present.
 java.util.List getGroupByAttributes()
          Returns attributes used in GROUP BY as an unmodifiable list.
 DbEntity getParentEntity()
          Returns the parentEntity.
 java.lang.String getParentEntityName()
          Returns the parentEntityName.
 java.lang.String getSchema()
          Returns schema of the parent entity.
 void removeAttribute(java.lang.String attrName)
          Removes attribute from the entity, removes any relationship joins containing this attribute.
 void resetToParentView()
          Removes all attributes and relationships, and replaces them with the data of the parent entity.
 void setCatalog(java.lang.String catalog)
          Throws exception.
 void setParentEntity(DbEntity parentEntity)
          Sets the parentEntity.
 void setParentEntityName(java.lang.String parentEntityName)
          Sets the parentEntityName.
 void setSchema(java.lang.String schema)
          Throws exception.
 
Methods inherited from class org.objectstyle.cayenne.map.DbEntity
addAttribute, clearAttributes, dbAttributeAdded, dbAttributeChanged, dbAttributeRemoved, getPrimaryKey, getPrimaryKeyGenerator, setPrimaryKeyGenerator, toString, validateQueryRoot
 
Methods inherited from class org.objectstyle.cayenne.map.Entity
addQuery, addRelationship, clearQueries, clearRelationships, getAttribute, getAttributeMap, getAttributes, getDataMap, getQuery, getRelationship, getRelationshipMap, getRelationships, removeQuery, removeRelationship, resolvePathComponents, resolvePathComponents, setDataMap
 
Methods inherited from class org.objectstyle.cayenne.map.MapObject
getName, getParent, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parentEntityName

protected java.lang.String parentEntityName
Constructor Detail

DerivedDbEntity

public DerivedDbEntity()
Constructor for DerivedDbEntity.


DerivedDbEntity

public DerivedDbEntity(java.lang.String name)
Constructor for DerivedDbEntity.


DerivedDbEntity

public DerivedDbEntity(java.lang.String name,
                       DbEntity parentEntity)
Constructor for DerivedDbEntity. Creates a derived entity with the attribute set of a parent entity.

Method Detail

resetToParentView

public void resetToParentView()
Removes all attributes and relationships, and replaces them with the data of the parent entity.


getParentEntity

public DbEntity getParentEntity()
Returns the parentEntity.


setParentEntity

public void setParentEntity(DbEntity parentEntity)
Sets the parentEntity.


getGroupByAttributes

public java.util.List getGroupByAttributes()
Returns attributes used in GROUP BY as an unmodifiable list.


getFullyQualifiedName

public java.lang.String getFullyQualifiedName()
Description copied from class: DbEntity
Returns table name including schema, if present.

Overrides:
getFullyQualifiedName in class DbEntity

getSchema

public java.lang.String getSchema()
Returns schema of the parent entity.

Overrides:
getSchema in class DbEntity

setSchema

public void setSchema(java.lang.String schema)
Throws exception.

Overrides:
setSchema in class DbEntity

getCatalog

public java.lang.String getCatalog()
Returns catalog of the parent entity.

Overrides:
getCatalog in class DbEntity

setCatalog

public void setCatalog(java.lang.String catalog)
Throws exception.

Overrides:
setCatalog in class DbEntity

removeAttribute

public void removeAttribute(java.lang.String attrName)
Description copied from class: DbEntity
Removes attribute from the entity, removes any relationship joins containing this attribute.

Overrides:
removeAttribute in class DbEntity

getParentEntityName

public java.lang.String getParentEntityName()
Returns the parentEntityName.


setParentEntityName

public void setParentEntityName(java.lang.String parentEntityName)
Sets the parentEntityName.