#2353 - Rename BeanPersistRequest methods with deprecation

This commit is contained in:
rbygrave
2021-09-03 18:01:27 +12:00
parent aa53742a07
commit b69c00b01e
51 changed files with 263 additions and 142 deletions
@@ -10,31 +10,62 @@ import io.ebean.Transaction;
public interface BeanDeleteIdRequest {
/**
* Return the server processing the request.
* @deprecated use {@link #getDatabase()}
* Deprecated migrate to database().
*/
@Deprecated
EbeanServer getEbeanServer();
/**
* Deprecated migrate to database().
*/
@Deprecated
default Database getDatabase() {
return getEbeanServer();
}
/**
* Return the DB processing the request.
*/
default Database getDatabase() {
default Database database() {
return getEbeanServer();
}
/**
* Return the Transaction associated with this request.
*/
Transaction getTransaction();
Transaction transaction();
/**
* Deprecated migrate to transaction().
*/
@Deprecated
default Transaction getTransaction() {
return transaction();
}
/**
* Returns the bean type of the bean being deleted.
*/
Class<?> getBeanType();
Class<?> beanType();
/**
* Deprecated migrate to beanType().
*/
@Deprecated
default Class<?> getBeanType() {
return beanType();
}
/**
* Returns the Id value of the bean being deleted.
*/
Object getId();
Object id();
/**
* Deprecated migrate to id().
*/
@Deprecated
default Object getId() {
return id();
}
}
@@ -1,5 +1,6 @@
package io.ebean.event;
import io.ebean.Database;
import io.ebean.EbeanServer;
import io.ebean.Transaction;
import io.ebean.ValuePair;
@@ -17,20 +18,44 @@ import java.util.Set;
public interface BeanPersistRequest<T> {
/**
* Return the server processing the request.
* Return the DB processing the request.
*/
default Database database() {
return getEbeanServer();
}
/**
* Deprecated migrate to database().
*/
@Deprecated
EbeanServer getEbeanServer();
/**
* Return the Transaction associated with this request.
*/
Transaction getTransaction();
Transaction transaction();
/**
* Deprecated migrate to transaction().
*/
@Deprecated
default Transaction getTransaction() {
return transaction();
}
/**
* For an update or delete of a partially populated bean this is the set of
* loaded properties and otherwise returns null.
*/
Set<String> getLoadedProperties();
Set<String> loadedProperties();
/**
* Deprecated migrate to loadedProperties().
*/
@Deprecated
default Set<String> getLoadedProperties() {
return loadedProperties();
}
/**
* For an update this is the set of properties that where updated.
@@ -39,12 +64,28 @@ public interface BeanPersistRequest<T> {
* should be preferred if it satisfies the requirement.
* </p>
*/
Set<String> getUpdatedProperties();
Set<String> updatedProperties();
/**
* Deprecated migrate to updatedProperties().
*/
@Deprecated
default Set<String> getUpdatedProperties() {
return updatedProperties();
}
/**
* Flags set for dirty properties (used by ElasticSearch integration).
*/
boolean[] getDirtyProperties();
boolean[] dirtyProperties();
/**
* Deprecated migrate to updatedProperties().
*/
@Deprecated
default boolean[] getDirtyProperties() {
return dirtyProperties();
}
/**
* Return true for an update request if at least one of dirty properties is contained
@@ -66,11 +107,27 @@ public interface BeanPersistRequest<T> {
/**
* Returns the bean being inserted updated or deleted.
*/
T getBean();
T bean();
/**
* Deprecated migrate to bean().
*/
@Deprecated
default T getBean() {
return bean();
}
/**
* Returns a map of the properties that have changed and their new and old values.
*/
Map<String, ValuePair> getUpdatedValues();
Map<String, ValuePair> updatedValues();
/**
* Deprecated migrate to updatedValues().
*/
@Deprecated
default Map<String, ValuePair> getUpdatedValues() {
return updatedValues();
}
}
@@ -1,5 +1,6 @@
package io.ebean.event;
import io.ebean.Database;
import io.ebean.EbeanServer;
import io.ebean.Query;
import io.ebean.Transaction;
@@ -10,19 +11,43 @@ import io.ebean.Transaction;
public interface BeanQueryRequest<T> {
/**
* Return the server processing the request.
* Return the DB processing the request.
*/
default Database database() {
return getEbeanServer();
}
/**
* Deprecated migrate to database().
*/
@Deprecated
EbeanServer getEbeanServer();
/**
* Return the Transaction associated with this request.
*/
Transaction getTransaction();
Transaction transaction();
/**
* Deprecated migrate to transaction().
*/
@Deprecated
default Transaction getTransaction() {
return transaction();
}
/**
* Returns the query.
*/
Query<T> getQuery();
Query<T> query();
/**
* Deprecated migrate to query().
*/
@Deprecated
default Query<T> getQuery() {
return query();
}
/**
* Return true if an Id IN expression should have the bind parameters padded.
@@ -8,7 +8,15 @@ public interface BulkTableEvent {
/**
* Return the name of the table that was involved.
*/
String getTableName();
String tableName();
/**
* Deprecated migrate to tableName().
*/
@Deprecated
default String getTableName() {
return tableName();
}
/**
* Return true if rows were inserted.