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.access
Class DataNode

    java.lang.Object
      org.apache.cayenne.access.DataNode

All Implemented Interfaces:
  QueryEngine

    public class DataNode

extends java.lang.Object
implements QueryEngine

An abstraction of a single physical data storage. This is usually a database server, but can potentially be some other storage type like an LDAP server, etc.

Field Summary
`protected DbAdapter` | `adapter`
`protected java.util.Map<java.lang.String,DataMap>` | `dataMaps`
`protected javax.sql.DataSource` | `dataSource`
`protected java.lang.String` | `dataSourceFactory`
`protected java.lang.String` | `dataSourceLocation`
`protected EntityResolver` | `entityResolver`
`protected java.lang.String` | `name`
`protected SchemaUpdateStrategy` | `schemaUpdateStrategy`
`protected java.lang.String` | `schemaUpdateStrategyName`

Constructor Summary
`DataNode()` Creates a new unnamed DataNode.
`DataNode(java.lang.String name)` Creates a new DataNode, assigning it a name.

Method Summary
`void` | `addDataMap(DataMap map)` Adds a DataMap to be handled by this node.
`DbAdapter` | `getAdapter()` Returns DbAdapter object.
`DataMap` | `getDataMap(java.lang.String name)` Returns datamap with specified name, null if none present
`java.util.Collection<DataMap>` | `getDataMaps()` Returns an unmodifiable collection of DataMaps handled by this DataNode.
`javax.sql.DataSource` | `getDataSource()` Returns DataSource used by this DataNode to obtain connections.
`java.lang.String` | `getDataSourceFactory()` Returns a name of DataSourceFactory class for this node.
`java.lang.String` | `getDataSourceLocation()` Returns a location of DataSource of this node.
`EntityResolver` | `getEntityResolver()` Returns EntityResolver that handles DataMaps of this node.
`JdbcEventLogger` | `getJdbcEventLogger()`
`java.lang.String` | `getName()` Returns node name.
`SchemaUpdateStrategy` | `getSchemaUpdateStrategy()`
`java.lang.String` | `getSchemaUpdateStrategyName()`
`DataNode` | `lookupDataNode(DataMap dataMap)` Returns a DataNode that should handle queries for all DataMap components.
`void` | `performQueries(java.util.Collection<? extends Query> queries, OperationObserver callback)` Runs queries using Connection obtained from internal DataSource.
`void` | `removeDataMap(DataMap map)`
`void` | `removeDataMap(java.lang.String mapName)`
`void` | `setAdapter(DbAdapter adapter)`
`void` | `setDataMaps(java.util.Collection<DataMap> dataMaps)`
`void` | `setDataSource(javax.sql.DataSource dataSource)`
`void` | `setDataSourceFactory(java.lang.String dataSourceFactory)`
`void` | `setDataSourceLocation(java.lang.String dataSourceLocation)`
`void` | `setEntityResolver(EntityResolver entityResolver)` Sets EntityResolver.
`void` | `setJdbcEventLogger(JdbcEventLogger logger)`
`void` | `setName(java.lang.String name)`
`void` | `setSchemaUpdateStrategy(SchemaUpdateStrategy schemaUpdateStrategy)`
`void` | `setSchemaUpdateStrategyName(java.lang.String schemaUpdateStrategyName)`
`void` | `shutdown()` Deprecated. since 3.1 does nothing as pool shutdown is performed by the DI container.

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

Field Detail

### name

    protected java.lang.String name

### dataSource

    protected javax.sql.DataSource dataSource

### adapter

    protected DbAdapter adapter

### dataSourceLocation

    protected java.lang.String dataSourceLocation

### dataSourceFactory

    protected java.lang.String dataSourceFactory

### schemaUpdateStrategyName

    protected java.lang.String schemaUpdateStrategyName

### entityResolver

    protected EntityResolver entityResolver

### schemaUpdateStrategy

    protected SchemaUpdateStrategy schemaUpdateStrategy

### dataMaps

    protected java.util.Map<java.lang.String,DataMap> dataMaps

Constructor Detail

### DataNode

    public DataNode()

  Creates a new unnamed DataNode.

### DataNode

    public DataNode(java.lang.String name)

  Creates a new DataNode, assigning it a name.

Method Detail

### getSchemaUpdateStrategyName

    public java.lang.String getSchemaUpdateStrategyName()

  Since:
    3.0

### setSchemaUpdateStrategyName

    public void setSchemaUpdateStrategyName(java.lang.String schemaUpdateStrategyName)

  Since:
    3.0

### getSchemaUpdateStrategy

    public SchemaUpdateStrategy getSchemaUpdateStrategy()

  Since:
    3.0

### setSchemaUpdateStrategy

    public void setSchemaUpdateStrategy(SchemaUpdateStrategy schemaUpdateStrategy)

  Since:
    3.0

### getJdbcEventLogger

    public JdbcEventLogger getJdbcEventLogger()

  Since:
    3.1

### setJdbcEventLogger

    public void setJdbcEventLogger(JdbcEventLogger logger)

  Since:
    3.1

### getName

    public java.lang.String getName()

  Returns node name. Name is used to uniquely identify DataNode within a DataDomain.

### setName

    public void setName(java.lang.String name)

### getDataSourceLocation

    public java.lang.String getDataSourceLocation()

  Returns a location of DataSource of this node. Depending on how this node was created, location is either a JNDI name, or a location of node XML file, etc.

### setDataSourceLocation

    public void setDataSourceLocation(java.lang.String dataSourceLocation)

### getDataSourceFactory

    public java.lang.String getDataSourceFactory()

  Returns a name of DataSourceFactory class for this node.

### setDataSourceFactory

    public void setDataSourceFactory(java.lang.String dataSourceFactory)

### getDataMaps

    public java.util.Collection<DataMap> getDataMaps()

  Returns an unmodifiable collection of DataMaps handled by this DataNode.

### getDataMap

    public DataMap getDataMap(java.lang.String name)

  Returns datamap with specified name, null if none present

### setDataMaps

    public void setDataMaps(java.util.Collection<DataMap> dataMaps)

### addDataMap

    public void addDataMap(DataMap map)

  Adds a DataMap to be handled by this node.

### removeDataMap

    public void removeDataMap(DataMap map)

### removeDataMap

    public void removeDataMap(java.lang.String mapName)

### getDataSource

    public javax.sql.DataSource getDataSource()

  Returns DataSource used by this DataNode to obtain connections.

### setDataSource

    public void setDataSource(javax.sql.DataSource dataSource)

### getAdapter

    public DbAdapter getAdapter()

  Returns DbAdapter object. This is a plugin that handles RDBMS vendor-specific features.

### setAdapter

    public void setAdapter(DbAdapter adapter)

### lookupDataNode

    public DataNode lookupDataNode(DataMap dataMap)

  Returns a DataNode that should handle queries for all DataMap components.

  Since:
    1.1

### performQueries

    public void performQueries(java.util.Collection<? extends Query> queries,
                               OperationObserver callback)

  Runs queries using Connection obtained from internal DataSource.

  Specified by:
    `performQueries` in interface `QueryEngine`
  Since:
    1.1

### getEntityResolver

    public EntityResolver getEntityResolver()

  Returns EntityResolver that handles DataMaps of this node.

  Specified by:
    `getEntityResolver` in interface `QueryEngine`

### setEntityResolver

    public void setEntityResolver(EntityResolver entityResolver)

  Sets EntityResolver. DataNode relies on externally set EntityResolver, so if the node is created outside of DataDomain stack, a valid EntityResolver must be provided explicitly.

  Since:
    1.1

### shutdown

    public void shutdown()

  Deprecated. since 3.1 does nothing as pool shutdown is performed by the DI container.

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-2012 Apache Cayenne. All Rights Reserved.