= Persistence Layer API

:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
:page-partial:


The persistence layer APIs provide domain objects with tools to manage the interactions with the persistence layer, for example adding on-the-fly caching to queries that are called many times within a loop.


.Persistence Layer API
[cols="2m,4a",options="header"]
|===

|API
|Description


|xref:refguide:applib:index/services/metrics/MetricsService.adoc[MetricsService]
|Gathers and provides metrics on the numbers of objects used within a transaction.


|xref:refguide:applib:index/services/queryresultscache/QueryResultsCache.adoc[QueryResultsCache]
|Request-scoped caching of the results of queries (or any data set generated by a given set of input arguments).



|xref:refguide:applib:index/services/repository/RepositoryService.adoc[RepositoryService]
|Methods to help implement repositories: query for existing objects, persist new or delete existing objects


|xref:refguide:applib:index/services/xactn/TransactionalProcessor.adoc[TransactionalProcessor]
|Running commands within a transaction


|xref:refguide:applib:index/services/xactn/TransactionService.adoc[TransactionService]
|Transaction management



|===



