# Deprecated API

## Contents

- Interfaces
- Classes
- Exception Classes
- Fields
- Methods
- Constructors

- Deprecated Interfaces
  Interface
  Description
  org.apache.cayenne.DataChannelFilter
  since 4.1 use `DataChannelQueryFilter` and `DataChannelSyncFilter`
  org.apache.cayenne.DataChannelFilterChain
  since 4.1 in favor of `DataChannelSyncFilterChain` and `DataChannelQueryFilterChain`
  org.apache.cayenne.reflect.Property
  since 4.0 renamed to PropertyDescriptor.

- Deprecated Classes
  Class
  Description
  org.apache.cayenne.access.LegacyDataDomainFlushAction
  this implementation is deprecated since 4.2, `DefaultDataDomainFlushAction` is used
  org.apache.cayenne.access.LegacyDataDomainFlushActionFactory
  org.apache.cayenne.access.translator.batch.legacy.DefaultBatchTranslator
  since 4.2
  org.apache.cayenne.access.translator.batch.legacy.DefaultBatchTranslatorFactory
  since 4.2
  org.apache.cayenne.access.translator.batch.legacy.DeleteBatchTranslator
  since 4.2
  org.apache.cayenne.access.translator.batch.legacy.InsertBatchTranslator
  since 4.2
  org.apache.cayenne.access.translator.batch.legacy.SoftDeleteBatchTranslator
  since 4.2
  org.apache.cayenne.access.translator.batch.legacy.SoftDeleteTranslatorFactory
  since 4.2
  org.apache.cayenne.access.translator.batch.legacy.UpdateBatchTranslator
  since 4.2
  org.apache.cayenne.access.translator.select.SelectQueryWrapper
  this class should gone with the `SelectQuery`
  org.apache.cayenne.dba.openbase.OpenBaseAdapter
  since 4.2, OpenBase is pretty much obsolete and not tested
  org.apache.cayenne.dba.openbase.OpenBasePkGenerator
  since 4.2
  org.apache.cayenne.dba.openbase.OpenBaseSniffer
  since 4.2
  org.apache.cayenne.dba.openbase.OpenBaseSQLTreeProcessor
  since 4.2
  org.apache.cayenne.exp.Property
  since 4.2 in favour of type-specific set of properties, see `PropertyFactory` and `org.apache.cayenne.exp.property` package.
  org.apache.cayenne.query.SelectQuery
  since 4.2, use `ObjectSelect`
  org.apache.cayenne.resource.FilesystemResourceLocator
  since 4.1. This can be implemented as a custom strategy outside Cayenne. There's no need for this object to be in Cayenne.
  org.apache.cayenne.tx.DefaultTransactionDescriptor
  since 4.2, use `TransactionDescriptor.defaultDescriptor()`

- Deprecated Exception Classes
  Exception Class
  Description
  org.apache.cayenne.CayenneException
  since 4.1 use `CayenneRuntimeException` instead

- Deprecated Fields
  Field
  Description
  org.apache.cayenne.access.DataContext.transactionFactory
  since 4.0 used in a method that itself should be deprecated, so this is a temp code
  org.apache.cayenne.access.DataDomain.filters
  since 4.1 this field is unused
  org.apache.cayenne.configuration.Constants.SERVER_DOMAIN_FILTERS_LIST
  since 4.1 domain filters replaced with query and sync filters
  org.apache.cayenne.configuration.Constants.SERVER_MAX_QUEUE_WAIT_TIME
  since 4.0 renamed to `Constants.JDBC_MAX_QUEUE_WAIT_TIME`. Property name is preserved.
  org.apache.cayenne.configuration.server.DataDomainProvider.filters
  since 4.1, use query and sync filters instead
  org.apache.cayenne.configuration.xml.ObjRelationshipHandler.DB_RELATIONSHIP_REF_TAG
  org.apache.cayenne.dba.JdbcAdapter.batchQueryBuilderFactory
  since 4.0 BatchQueryBuilderfactory is attached to the DataNode.
  org.apache.cayenne.dba.sqlserver.SQLServerAdapter.TRIM_FUNCTION
  since 4.2 unused
  org.apache.cayenne.exp.Property.COUNT
  since 4.2 use `PropertyFactory.COUNT`

- Deprecated Methods
  Method
  Description
  org.apache.cayenne.access.DataContext.setTransactionFactory(TransactionFactory)
  since 4.0 avoid using this directly. Transaction management at this level will be eventually removed
  org.apache.cayenne.access.DataDomain.addFilter(DataChannelFilter)
  since 4.1 use `DataDomain.addQueryFilter(DataChannelQueryFilter)` and `DataDomain.addSyncFilter(DataChannelSyncFilter)` instead
  org.apache.cayenne.access.DataDomain.getFilters()
  since 4.1 use `DataDomain.getQueryFilters()` and `DataDomain.getSyncFilters()`
  org.apache.cayenne.access.DataDomain.initWithProperties(Map<String, String>)
  since 4.0 properties are processed by the DI provider.
  org.apache.cayenne.access.DataDomain.removeFilter(DataChannelFilter)
  since 4.1 use `DataDomain.removeQueryFilter(DataChannelQueryFilter)` and `DataDomain.removeSyncFilter(DataChannelSyncFilter)` instead
  org.apache.cayenne.access.OperationObserver.nextGeneratedRows(Query, ResultIterator<?>, ObjectId)
  since 4.2, use `OperationObserver.nextGeneratedRows(Query, ResultIterator, List)`
  org.apache.cayenne.cache.NestedQueryCache.clear()
  since 4.0
  org.apache.cayenne.cache.QueryCache.clear()
  since 4.0. Please use implementation specific methods to perform cache management tasks.
  org.apache.cayenne.CayenneDataObject.makePath(String...)
  since 4.1, use `Cayenne.makePath(String...)` instead
  org.apache.cayenne.CayenneException.getExceptionLabel()
  since 4.1 use `CayenneRuntimeException.getExceptionLabel()`
  org.apache.cayenne.configuration.server.ServerModule.contributeDomainFilters(Binder)
  since 4.1 use `ServerModule.contributeDomainQueryFilters(Binder)` and `ServerModule.contributeDomainSyncFilters(Binder)`
  org.apache.cayenne.conn.DataSourceInfo.getPasswordEncoder()
  since 4.0 as class loading should not happen here.
  org.apache.cayenne.dba.AutoAdapter.getSelectTranslator(SelectQuery<?>, EntityResolver)
  org.apache.cayenne.dba.DbAdapter.getSelectTranslator(SelectQuery<?>, EntityResolver)
  since 4.2 as `SelectQuery` is deprecated. `DbAdapter.getSelectTranslator(FluentSelect, EntityResolver)` replaces this method.
  org.apache.cayenne.dba.JdbcActionBuilder.objectSelectAction(SelectQuery<T>)
  org.apache.cayenne.dba.JdbcAdapter.createPkGenerator()
  org.apache.cayenne.dba.JdbcAdapter.getSelectTranslator(SelectQuery<?>, EntityResolver)
  org.apache.cayenne.dba.TypesMapping.supportsLength(int)
  Returns true if supplied type can have a length attribute as a part of column definition.
  org.apache.cayenne.ejbql.parser.JavaCharStream.getColumn()
  org.apache.cayenne.ejbql.parser.JavaCharStream.getLine()
  org.apache.cayenne.exp.property.BaseProperty.path()
  since 4.2, use `BaseProperty.getExpression()` method instead
  org.apache.cayenne.map.ObjEntity.getJavaClass()
  since 4.0 this method based on statically defined class loading algorithm is not going to work in environments like OSGi. `AdhocObjectFactory` should be used as it can provide the environment-specific class loading policy.
  org.apache.cayenne.map.ObjRelationship.recalculateReadOnlyValue()
  since 4.2
  org.apache.cayenne.map.SelectQueryDescriptor.addPrefetch(String)
  since 4.1 use `SelectQueryDescriptor.addPrefetch(String, int)`
  org.apache.cayenne.map.SelectQueryDescriptor.getPrefetches()
  since 4.1 use `SelectQueryDescriptor.getPrefetchesMap()`.
  org.apache.cayenne.map.SelectQueryDescriptor.setPrefetches(List<String>)
  since 4.1 use `SelectQueryDescriptor.setPrefetchesMap(HashMap)`.
  org.apache.cayenne.query.ColumnSelect.avg(Property<?>)
  since 4.2 use `ColumnSelect.avg(NumericProperty)`
  org.apache.cayenne.query.ColumnSelect.sum(Property<E>)
  since 4.2 use `ColumnSelect.sum(NumericProperty)`
  org.apache.cayenne.query.ObjectSelect.avg(Property<E>)
  since 4.2 use `ObjectSelect.avg(NumericProperty)`
  org.apache.cayenne.query.ObjectSelect.sum(Property<E>)
  since 4.2 use `ObjectSelect.sum(NumericProperty)`
  org.apache.cayenne.query.SelectQuery.setFetchingDataRows(boolean)
  since 4.0, use `SelectQuery.dataRowQuery(Class, Expression)` to create DataRow query instead.
  org.apache.cayenne.query.SQLActionVisitor.objectSelectAction(SelectQuery<T>)
  since 4.2 as part of `SelectQuery` deprecation
  org.apache.cayenne.query.SQLSelect.params(String, Object)
  since 4.2 Use `SQLSelect.param(String, Object)`
  org.apache.cayenne.query.SQLSelect.scalarQuery(Class<T>, String)
  since 4.2. Use `SQLSelect.scalarQuery(String, Class)` method.
  org.apache.cayenne.query.SQLSelect.scalarQuery(Class<T>, String, String)
  since 4.2. Use `SQLSelect.scalarQuery(String, String, Class)` method.
  org.apache.cayenne.query.SQLSelect.scalarQuery(String)
  since 4.2. Use `SQLSelect.columnQuery(String)`
  org.apache.cayenne.query.SQLSelect.scalarQuery(String, Class<?>...)
  since 4.2. Use `SQLSelect.columnQuery(String, Class...)`
  org.apache.cayenne.query.SQLSelect.scalarQuery(String, String)
  since 4.2. Use `SQLSelect.columnQuery(String, String)`
  org.apache.cayenne.query.SQLSelect.scalarQuery(String, String, Class<?>...)
  since 4.2. Use `SQLSelect.columnQuery(String, String, Class...)`
  org.apache.cayenne.util.Util.getJavaClass(String)
  since 4.0 this method based on statically defined class loading algorithm is not going to work in environments like OSGi. `AdhocObjectFactory` should be used as it can provide the environment-specific class loading policy.

- Deprecated Constructors
  Constructor
  Description
  org.apache.cayenne.access.DataDomain(String, Map<String, String>)
  since 4.0 unused
  org.apache.cayenne.access.translator.select.DefaultSelectTranslator(SelectQuery<?>, DbAdapter, EntityResolver)
  since 4.2 as `SelectQuery` is deprecated.
  org.apache.cayenne.query.RefreshQuery()
  since 4.0, "refresh all" query will drop all cache contents
  org.apache.cayenne.tx.TransactionDescriptor(int)
  since 4.2. Use `TransactionDescriptor.builder()` method instead.
  org.apache.cayenne.tx.TransactionDescriptor(int, TransactionPropagation)
  since 4.2. Use `TransactionDescriptor.builder()` method instead.
  org.apache.cayenne.tx.TransactionDescriptor(TransactionPropagation)
  since 4.2. Use `TransactionDescriptor.builder()` method instead.