* Copyright (c) 2010-2011. Axon Framework
* Licensed 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
* 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.
and have the proper JPA Annotations.
Optionally, the repository may be configured with a locking scheme. The repository will always force optimistic locking in the backing data store. The optional lock in the repository is in addition to this optimistic lock. Note that locks on this repository will not be shared with other repository instances.
When this repository is requested to persist changes to an aggregate, it will also flush the EntityManager, to enforce checking of database constraints and optimistic locks.
<> The type of aggregate the repository provides access to
Flushing the EntityManager will force JPA to send state changes to the database. Any key violations and failing optimistic locks will be identified in an early stage.
forceFlushOnSavewhether or not to flush the EntityManager after each save. Defaults to