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

Quick Search    Search Deep

org.objectstyle.cayenne.access
Class EntityResolver  view EntityResolver download EntityResolver.java

java.lang.Object
  extended byorg.objectstyle.cayenne.access.EntityResolver

public class EntityResolver
extends java.lang.Object

EntityResolver encapsulates resolving between ObjEntities, DbEntities, DataObject Classes, and Entity names. An instance is typically obtained from a QueryEngine by getEntityResolver. EntityResolver is thread-safe.


Field Summary
protected  java.util.Map dbEntityCache
           
protected  java.util.List maps
           
protected  java.util.List mapsRef
           
protected  java.util.Map objEntityCache
           
protected  java.util.Map procedureCache
           
 
Constructor Summary
EntityResolver()
           
EntityResolver(java.util.Collection dataMaps)
          Constructor for EntityResolver.
 
Method Summary
private  org.objectstyle.cayenne.map.DbEntity _lookupDbEntity(java.lang.Object object)
          Internal usage only - provides the type-unsafe implementation which services the four typesafe public lookupDbEntity methods Looks in the DataMap's that this object was created with for the ObjEntity that maps to the specified object.
private  org.objectstyle.cayenne.map.ObjEntity _lookupObjEntity(java.lang.Object object)
          Internal usage only - provides the type-unsafe implementation which services the three typesafe public lookupObjEntity methods Looks in the DataMap's that this object was created with for the ObjEntity that maps to the specified object.
 void addDataMap(org.objectstyle.cayenne.map.DataMap map)
          Adds a DataMap to the list handled by resolver.
protected  void clearCache()
          Removes all entity mappings from the cache.
protected  void constructCache()
          Creates caches of DbEntities by ObjEntity, DataObject class, and ObjEntity name using internal list of maps.
 org.objectstyle.cayenne.map.DataMap getDataMap(java.lang.String mapName)
          Returns a DataMap matching the name.
 java.util.Collection getDataMaps()
          Returns an unmodifiable collection of DataMaps.
 org.objectstyle.cayenne.map.DbEntity lookupDbEntity(java.lang.Class aClass)
          Looks in the DataMap's that this object was created with for the DbEntity that services the specified class
 org.objectstyle.cayenne.map.DbEntity lookupDbEntity(org.objectstyle.cayenne.DataObject dataObject)
          Looks in the DataMap's that this object was created with for the DbEntity that services the specified data Object
 org.objectstyle.cayenne.map.DbEntity lookupDbEntity(org.objectstyle.cayenne.map.ObjEntity entity)
          Looks in the DataMap's that this object was created with for the DbEntity that services the specified objentity
 org.objectstyle.cayenne.map.DbEntity lookupDbEntity(org.objectstyle.cayenne.query.Query q)
          Looks up the DbEntity for the given query by using the query's getRoot method and passing to lookupDbEntity
 org.objectstyle.cayenne.map.DbEntity lookupDbEntity(java.lang.String entityName)
          Looks in the DataMap's that this object was created with for the DbEntity that services the class with the given name
 org.objectstyle.cayenne.map.ObjEntity lookupObjEntity(java.lang.Class aClass)
          Looks in the DataMap's that this object was created with for the ObjEntity that maps to the services the specified class
 org.objectstyle.cayenne.map.ObjEntity lookupObjEntity(org.objectstyle.cayenne.DataObject dataObject)
          Looks in the DataMap's that this object was created with for the ObjEntity that services the specified data Object
 org.objectstyle.cayenne.map.ObjEntity lookupObjEntity(org.objectstyle.cayenne.query.Query q)
          Looks up the ObjEntity for the given query by using the query's getRoot method and passing to lookupObjEntity
 org.objectstyle.cayenne.map.ObjEntity lookupObjEntity(java.lang.String entityName)
          Looks in the DataMap's that this object was created with for the ObjEntity that maps to the services the class with the given name
 org.objectstyle.cayenne.map.Procedure lookupProcedure(org.objectstyle.cayenne.query.Query q)
           
 org.objectstyle.cayenne.map.Procedure lookupProcedure(java.lang.String procedureName)
           
 org.objectstyle.cayenne.query.SelectQuery lookupQuery(java.lang.Class queryRoot, java.lang.String queryName)
          Searches for the named query associated with the ObjEntity corresponding to the Java class specified.
 void removeDataMap(org.objectstyle.cayenne.map.DataMap map)
           
 void setDataMaps(java.util.Collection maps)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbEntityCache

protected java.util.Map dbEntityCache

objEntityCache

protected java.util.Map objEntityCache

procedureCache

protected java.util.Map procedureCache

maps

protected java.util.List maps

mapsRef

protected java.util.List mapsRef
Constructor Detail

EntityResolver

public EntityResolver()

EntityResolver

public EntityResolver(java.util.Collection dataMaps)
Constructor for EntityResolver.

Method Detail

addDataMap

public void addDataMap(org.objectstyle.cayenne.map.DataMap map)
Adds a DataMap to the list handled by resolver.


removeDataMap

public void removeDataMap(org.objectstyle.cayenne.map.DataMap map)

getDataMap

public org.objectstyle.cayenne.map.DataMap getDataMap(java.lang.String mapName)
Returns a DataMap matching the name.


setDataMaps

public void setDataMaps(java.util.Collection maps)

getDataMaps

public java.util.Collection getDataMaps()
Returns an unmodifiable collection of DataMaps.


clearCache

protected void clearCache()
Removes all entity mappings from the cache. Cache can be rebuilt either explicitly by calling constructCache, or on demand by calling any of the lookup... methods.


constructCache

protected void constructCache()
Creates caches of DbEntities by ObjEntity, DataObject class, and ObjEntity name using internal list of maps.


lookupDbEntity

public org.objectstyle.cayenne.map.DbEntity lookupDbEntity(java.lang.Class aClass)
Looks in the DataMap's that this object was created with for the DbEntity that services the specified class


lookupDbEntity

public org.objectstyle.cayenne.map.DbEntity lookupDbEntity(org.objectstyle.cayenne.map.ObjEntity entity)
Looks in the DataMap's that this object was created with for the DbEntity that services the specified objentity


lookupDbEntity

public org.objectstyle.cayenne.map.DbEntity lookupDbEntity(java.lang.String entityName)
Looks in the DataMap's that this object was created with for the DbEntity that services the class with the given name


lookupDbEntity

public org.objectstyle.cayenne.map.DbEntity lookupDbEntity(org.objectstyle.cayenne.DataObject dataObject)
Looks in the DataMap's that this object was created with for the DbEntity that services the specified data Object


_lookupDbEntity

private org.objectstyle.cayenne.map.DbEntity _lookupDbEntity(java.lang.Object object)
Internal usage only - provides the type-unsafe implementation which services the four typesafe public lookupDbEntity methods Looks in the DataMap's that this object was created with for the ObjEntity that maps to the specified object. Object may be a Entity name, ObjEntity, DataObject class (Class object for a class which implements the DataObject interface), or a DataObject instance itself


lookupDbEntity

public org.objectstyle.cayenne.map.DbEntity lookupDbEntity(org.objectstyle.cayenne.query.Query q)
Looks up the DbEntity for the given query by using the query's getRoot method and passing to lookupDbEntity


lookupObjEntity

public org.objectstyle.cayenne.map.ObjEntity lookupObjEntity(java.lang.Class aClass)
Looks in the DataMap's that this object was created with for the ObjEntity that maps to the services the specified class


lookupObjEntity

public org.objectstyle.cayenne.map.ObjEntity lookupObjEntity(java.lang.String entityName)
Looks in the DataMap's that this object was created with for the ObjEntity that maps to the services the class with the given name


lookupObjEntity

public org.objectstyle.cayenne.map.ObjEntity lookupObjEntity(org.objectstyle.cayenne.DataObject dataObject)
Looks in the DataMap's that this object was created with for the ObjEntity that services the specified data Object


_lookupObjEntity

private org.objectstyle.cayenne.map.ObjEntity _lookupObjEntity(java.lang.Object object)
Internal usage only - provides the type-unsafe implementation which services the three typesafe public lookupObjEntity methods Looks in the DataMap's that this object was created with for the ObjEntity that maps to the specified object. Object may be a Entity name, DataObject instance or DataObject class (Class object for a class which implements the DataObject interface)


lookupObjEntity

public org.objectstyle.cayenne.map.ObjEntity lookupObjEntity(org.objectstyle.cayenne.query.Query q)
Looks up the ObjEntity for the given query by using the query's getRoot method and passing to lookupObjEntity


lookupQuery

public org.objectstyle.cayenne.query.SelectQuery lookupQuery(java.lang.Class queryRoot,
                                                             java.lang.String queryName)
Searches for the named query associated with the ObjEntity corresponding to the Java class specified. Returns such query if found, null otherwise.


lookupProcedure

public org.objectstyle.cayenne.map.Procedure lookupProcedure(org.objectstyle.cayenne.query.Query q)

lookupProcedure

public org.objectstyle.cayenne.map.Procedure lookupProcedure(java.lang.String procedureName)