= Migrating from 2.0.0-RC4 to 2.0.0

: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:


== Programming Model (CAUSEWAY-3697)

Annotation attribute
`@DomainService(nature=..)` was marked for removal and no longer has any scope filtering effect.
This filtering is or will be replaced by some other mechanism eg. configuration option.

== Programming Model (CAUSEWAY-3692)

Annotation attribute
`@Parameter(dependentDefaultsPolicy=..)` was renamed to
`@Parameter(precedingParamsPolicy=..)`, also enum
`DependentDefaultsPolicy` was renamed to `PrecedingParamsPolicy` and enum value
`UPDATE_DEPENDENT` was renamed to `RESET`.

CausewayConfiguration also changed:

[source]
----
#old
causeway.applib.annotation.parameter.dependentDefaultsPolicy=..
#new
causeway.applib.annotation.parameter.precedingParametersPolicy=..
----

== AuditTrailEntryRepository and others have simplified the API (CAUSEWAY-3390)

In this release the `AuditTrailEntryRepository` and similar is no longer parameterized by the entity type, and is also an interface.

So, instead of:

[source,java]
----
@Inject AuditTrailEntryRepository<? extends AuditTrailEntry> auditTrailEntryRepository;
----

it should now be just:

[source,java]
----
@Inject AuditTrailEntryRepository auditTrailEntryRepository;
----

This applies to:

* xref:refguide:extensions:index/audittrail/applib/dom/AuditTrailEntryRepository.adoc[]
* xref:refguide:extensions:index/commandlog/applib/dom/CommandLogEntryRepository.adoc[]
* xref:refguide:extensions:index/executionlog/applib/dom/ExecutionLogEntryRepository.adoc[]
* xref:refguide:extensions:index/executionoutbox/applib/dom/ExecutionOutboxEntryRepository.adoc[]
* xref:refguide:extensions:index/sessionlog/applib/dom/SessionLogEntryRepository.adoc[]

For more details, see link:https://issues.apache.org/jira/browse/CAUSEWAY-3390[CAUSEWAY-3390].


== Auto-flush management (CAUSEWAY-3675)

By default any queries executed by xref:refguide:applib:index/services/repository/RepositoryService.adoc[] are preceded by a flush first.
The rationale behind this is to make sure that everything that might have changed is in the database.

However, with JDO at least, this behaviour can cause a `ConcurrentModificationException` when coupled with the  xref:refguide:persistence:index/commons/integration/changetracking/EntityChangeTrackerDefault.adoc[] internal service, used by auditing.
This grabs the value of properties, including derived properties that are evaluated using a query.

So now, xref:refguide:persistence:index/commons/integration/changetracking/EntityChangeTrackerDefault.adoc[] suppresses the autoflush.

Changes:

* To revert to the original behaviour, use the new `causeway.commons.persistence.entity-change-tracker.suppress-auto-flush` property.

* The `causeway.core.runtime-services.repository=service.disable-auto-flush` configuration property has been renamed to `causeway.commons.persistence.repository-service.disable-auto-flush`.

For more details, see link:https://issues.apache.org/jira/browse/CAUSEWAY-3675[CAUSEWAY-3675].


== Mavendeps webapp module and the GraphQL viewer (CAUSEWAY-3676)

The GraphQL viewer is a brand new viewer, automatically exposing your domain object model as a GraphQL API.
The documentation can be found xref:gqlv:ROOT:about.adoc[here].


As part of this work, the `org.apache.causeway.mavendeps:causeway-mavendeps-webapp` convenience module has been updated.
It now references all 3 viewers (Wicket, Restful and GraphQL) as a one-stop shop for bringing in viewers.

[source,xml]
.pom.xml
----
<dependency>
    <groupId>org.apache.causeway.mavendeps</groupId>
	<artifactId>causeway-mavendeps-webapp</artifactId>
</dependency>
----

It is still necessary to add in the persistence and security modules.

For more details, see link:https://issues.apache.org/jira/browse/CAUSEWAY-3676[CAUSEWAY-3676].

