diff --git a/ebean-api/pom.xml b/ebean-api/pom.xml
index b6adad05d..c5621372b 100644
--- a/ebean-api/pom.xml
+++ b/ebean-api/pom.xml
@@ -4,7 +4,7 @@
ebean-parentio.ebean
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTebean api
@@ -37,26 +37,26 @@
io.avajeavaje-jsr305
- 1.0
+ 1.1providedio.ebeanpersistence-api
- 2.2.4
+ 2.2.5io.ebeanebean-annotation
- 7.2
+ 7.3io.ebeanebean-types
- 2.1
+ 2.2
@@ -104,6 +104,13 @@
true
+
+ io.avaje
+ junit
+ 1.0
+ test
+
+
diff --git a/ebean-api/src/main/java/io/ebean/BeanFinder.java b/ebean-api/src/main/java/io/ebean/BeanFinder.java
index 2c8e04eec..aab61b572 100644
--- a/ebean-api/src/main/java/io/ebean/BeanFinder.java
+++ b/ebean-api/src/main/java/io/ebean/BeanFinder.java
@@ -79,11 +79,11 @@ public abstract class BeanFinder {
/**
* Creates an entity reference for this ID.
*
- * Equivalent to {@link Database#getReference(Class, Object)}
+ * Equivalent to {@link Database#reference(Class, Object)}
*/
@Nonnull
public T ref(I id) {
- return db().getReference(type, id);
+ return db().reference(type, id);
}
/**
diff --git a/ebean-api/src/main/java/io/ebean/BeanState.java b/ebean-api/src/main/java/io/ebean/BeanState.java
index daf163cc7..20aa0f8e4 100644
--- a/ebean-api/src/main/java/io/ebean/BeanState.java
+++ b/ebean-api/src/main/java/io/ebean/BeanState.java
@@ -57,7 +57,7 @@ public interface BeanState {
*
* // set loaded state on the email property to false so that
* // the email property is not included in a stateless update
- * DB.getBeanState(user).setPropertyLoaded("email", false);
+ * DB.beanState(user).setPropertyLoaded("email", false);
*
* user.update();
*
@@ -72,25 +72,47 @@ public interface BeanState {
* bean.
*
* Accessing another property will cause lazy loading to occur.
- *
*/
- Set getLoadedProps();
+ Set loadedProps();
+
+ /**
+ * Deprecated migrate to loadedProps().
+ */
+ @Deprecated
+ default Set getLoadedProps() {
+ return loadedProps();
+ }
/**
* Return the set of changed properties.
*/
- Set getChangedProps();
+ Set changedProps();
+
+ /**
+ * Deprecated migrate to changedProps().
+ */
+ @Deprecated
+ default Set getChangedProps() {
+ return changedProps();
+ }
/**
* Return a map of the updated properties and their new and old values.
*/
- Map getDirtyValues();
+ Map dirtyValues();
+
+ /**
+ * Deprecated migrate to dirtyValues().
+ */
+ @Deprecated
+ default Map getDirtyValues() {
+ return dirtyValues();
+ }
/**
* Return true if the bean is readOnly.
*
* If a setter is called on a readOnly bean it will throw an exception.
- *
*/
boolean isReadOnly();
@@ -114,13 +136,29 @@ public interface BeanState {
void resetForInsert();
/**
- * Returns a map with load erros.
+ * Returns a map with load errors.
*/
@Nullable
- Map getLoadErrors();
+ Map loadErrors();
+
+ /**
+ * Deprecated migrate to loadErrors().
+ */
+ @Deprecated
+ default Map getLoadErrors() {
+ return loadErrors();
+ }
/**
* Return the sort order value for an order column.
*/
- int getSortOrder();
+ int sortOrder();
+
+ /**
+ * Deprecated migrate to sortOrder().
+ */
+ @Deprecated
+ default int getSortOrder() {
+ return sortOrder();
+ }
}
diff --git a/ebean-api/src/main/java/io/ebean/DB.java b/ebean-api/src/main/java/io/ebean/DB.java
index a16ce3513..9bcfb047d 100644
--- a/ebean-api/src/main/java/io/ebean/DB.java
+++ b/ebean-api/src/main/java/io/ebean/DB.java
@@ -126,8 +126,16 @@ public final class DB {
* an expression that uses OR like Expression e = Expr.or(..., ...);
*
*/
+ public static ExpressionFactory expressionFactory() {
+ return getDefault().expressionFactory();
+ }
+
+ /**
+ * Deprecated migrate to expressionFactory().
+ */
+ @Deprecated
public static ExpressionFactory getExpressionFactory() {
- return getDefault().getExpressionFactory();
+ return expressionFactory();
}
/**
@@ -650,8 +658,16 @@ public final class DB {
* @param beanType the type of entity bean
* @param id the id value
*/
+ public static T reference(Class beanType, Object id) {
+ return getDefault().reference(beanType, id);
+ }
+
+ /**
+ * Deprecated migrate to beanId().
+ */
+ @Deprecated
public static T getReference(Class beanType, Object id) {
- return getDefault().getReference(beanType, id);
+ return reference(beanType, id);
}
/**
@@ -660,14 +676,12 @@ public final class DB {
*
*
asc - ascending order (which is the default)
*
desc - Descending order
- *
nullsHigh - Treat null values as high/large values (which is the
- * default)
+ *
nullsHigh - Treat null values as high/large values (which is the default)
*
nullsLow- Treat null values as low/very small values
*
*
* If you leave off any keywords the defaults are ascending order and treating
* nulls as high values.
- *
*
* Note that the sorting uses a Comparator and Collections.sort(); and does
* not invoke a DB query.
@@ -1231,30 +1245,77 @@ public final class DB {
* This will return null if the bean is not an enhanced entity bean.
*
*/
+ public static BeanState beanState(Object bean) {
+ return getDefault().beanState(bean);
+ }
+
+ /**
+ * Deprecated migrate to beanState().
+ */
+ @Deprecated
public static BeanState getBeanState(Object bean) {
- return getDefault().getBeanState(bean);
+ return beanState(bean);
}
/**
* Return the value of the Id property for a given bean.
*/
+ public static Object beanId(Object bean) {
+ return getDefault().beanId(bean);
+ }
+
+ /**
+ * Deprecated migrate to beanId().
+ */
+ @Deprecated
public static Object getBeanId(Object bean) {
- return getDefault().getBeanId(bean);
+ return beanId(bean);
+ }
+
+ /**
+ * Load and lock the bean using {@code select for update}.
+ *
+ * This should be executed inside a transaction.
+ *
+ * The bean needs to have an ID property set and can be a reference bean (only has ID)
+ * or partially or fully populated bean. This will load all the properties of the bean
+ * from the database using {@code select for update}.
+ *
+ * @param bean The entity bean that we wish to obtain a database lock on.
+ */
+ public static void lock(Object bean) {
+ getDefault().lock(bean);
+ }
+
+ /**
+ * Deprecated migrate to cacheManager().
+ */
+ @Deprecated
+ public static ServerCacheManager getServerCacheManager() {
+ return getDefault().cacheManager();
}
/**
* Return the manager of the level 2 cache ("L2" cache).
*/
- public static ServerCacheManager getServerCacheManager() {
- return getDefault().getServerCacheManager();
+ public static ServerCacheManager cacheManager() {
+ return getDefault().cacheManager();
}
/**
* Return the BackgroundExecutor service for asynchronous processing of
* queries.
*/
+ public static BackgroundExecutor backgroundExecutor() {
+ return getDefault().backgroundExecutor();
+ }
+
+ /**
+ * Deprecated migrate to backgroundExecutor().
+ */
+ @Deprecated
public static BackgroundExecutor getBackgroundExecutor() {
- return getDefault().getBackgroundExecutor();
+ return backgroundExecutor();
}
/**
diff --git a/ebean-api/src/main/java/io/ebean/Database.java b/ebean-api/src/main/java/io/ebean/Database.java
index bd38253de..396f3225a 100644
--- a/ebean-api/src/main/java/io/ebean/Database.java
+++ b/ebean-api/src/main/java/io/ebean/Database.java
@@ -120,34 +120,82 @@ public interface Database {
/**
* Return AutoTune which is used to control the AutoTune service at runtime.
*/
- AutoTune getAutoTune();
+ AutoTune autoTune();
+
+ /**
+ * Deprecated migrate to autoTune().
+ */
+ @Deprecated
+ default AutoTune getAutoTune() {
+ return autoTune();
+ }
/**
* Return the associated DataSource for this Database instance.
*/
- DataSource getDataSource();
+ DataSource dataSource();
+
+ /**
+ * Deprecated migrate to dataSource().
+ */
+ @Deprecated
+ default DataSource getDataSource() {
+ return dataSource();
+ }
/**
* Return the associated read only DataSource for this Database instance (can be null).
*/
- DataSource getReadOnlyDataSource();
+ DataSource readOnlyDataSource();
+
+ /**
+ * Deprecated migrate to readOnlyDataSource().
+ */
+ @Deprecated
+ default DataSource getReadOnlyDataSource() {
+ return readOnlyDataSource();
+ }
/**
* Return the name. This is used with {@link DB#byName(String)} to get a
* Database that was registered with the DB singleton.
*/
- String getName();
+ String name();
+
+ /**
+ * Deprecated migrate to name().
+ */
+ @Deprecated
+ default String getName() {
+ return name();
+ }
/**
* Return the ExpressionFactory for this database.
*/
- ExpressionFactory getExpressionFactory();
+ ExpressionFactory expressionFactory();
+
+ /**
+ * Deprecated migrate to expressionFactory().
+ */
+ @Deprecated
+ default ExpressionFactory getExpressionFactory() {
+ return expressionFactory();
+ }
/**
* Return the MetaInfoManager which is used to get meta data from the Database
* such as query execution statistics.
*/
- MetaInfoManager getMetaInfoManager();
+ MetaInfoManager metaInfo();
+
+ /**
+ * Deprecated migrate to metaInfo().
+ */
+ @Deprecated
+ default MetaInfoManager getMetaInfoManager() {
+ return metaInfo();
+ }
/**
* Return the platform used for this database instance.
@@ -166,12 +214,28 @@ public interface Database {
*
* @return platform for this database instance
*/
- Platform getPlatform();
+ Platform platform();
+
+ /**
+ * Deprecated migrate to platform().
+ */
+ @Deprecated
+ default Platform getPlatform() {
+ return platform();
+ }
/**
* Return the extended API intended for use by plugins.
*/
- SpiServer getPluginApi();
+ SpiServer pluginApi();
+
+ /**
+ * Deprecated migrate to pluginApi().
+ */
+ @Deprecated
+ default SpiServer getPluginApi() {
+ return pluginApi();
+ }
/**
* Return the BeanState for a given entity bean.
@@ -179,12 +243,28 @@ public interface Database {
* This will return null if the bean is not an enhanced entity bean.
*
*/
- BeanState getBeanState(Object bean);
+ BeanState beanState(Object bean);
+
+ /**
+ * Deprecated migrate to beanState().
+ */
+ @Deprecated
+ default BeanState getBeanState(Object bean) {
+ return beanState(bean);
+ }
/**
* Return the value of the Id property for a given bean.
*/
- Object getBeanId(Object bean);
+ Object beanId(Object bean);
+
+ /**
+ * Deprecated migrate to beanId().
+ */
+ @Deprecated
+ default Object getBeanId(Object bean) {
+ return beanId(bean);
+ }
/**
* Set the Id value onto the bean converting the type of the id value if necessary.
@@ -196,7 +276,15 @@ public interface Database {
* @param bean The entity bean to set the id value on.
* @param id The id value to set.
*/
- Object setBeanId(Object bean, Object id);
+ Object beanId(Object bean, Object id);
+
+ /**
+ * Deprecated migrate to beanId().
+ */
+ @Deprecated
+ default Object setBeanId(Object bean, Object id) {
+ return beanId(bean, id);
+ }
/**
* Return a map of the differences between two objects of the same type.
@@ -862,7 +950,15 @@ public interface Database {
* @param id the id value
*/
@Nonnull
- T getReference(Class beanType, Object id);
+ T reference(Class beanType, Object id);
+
+ /**
+ * Deprecated migrate to reference().
+ */
+ @Deprecated
+ default T getReference(Class beanType, Object id) {
+ return reference(beanType, id);
+ }
/**
* Return the extended API for Database.
@@ -1431,13 +1527,29 @@ public interface Database {
/**
* Return the manager of the server cache ("L2" cache).
*/
- ServerCacheManager getServerCacheManager();
+ ServerCacheManager cacheManager();
+
+ /**
+ * Deprecated migrate to cacheManager().
+ */
+ @Deprecated
+ default ServerCacheManager getServerCacheManager() {
+ return cacheManager();
+ }
/**
* Return the BackgroundExecutor service for asynchronous processing of
* queries.
*/
- BackgroundExecutor getBackgroundExecutor();
+ BackgroundExecutor backgroundExecutor();
+
+ /**
+ * Deprecated migrate to backgroundExecutor().
+ */
+ @Deprecated
+ default BackgroundExecutor getBackgroundExecutor() {
+ return backgroundExecutor();
+ }
/**
* Return the JsonContext for reading/writing JSON.
@@ -1602,6 +1714,20 @@ public interface Database {
*/
Set validateQuery(Query query);
+ /**
+ * Load and lock the bean using {@code select for update}.
+ *
+ * This should be executed inside a transaction and results in the bean being loaded or
+ * refreshed from the database and a database row lock held via {@code select for update}.
+ *
+ * The bean needs to have an ID property set and can be a reference bean (only has ID)
+ * or partially or fully populated bean. This will load all the properties of the bean
+ * from the database using {@code select for update} obtaining a database row lock (using WAIT).
+ *
+ * @param bean The entity bean that we wish to obtain a database lock on.
+ */
+ void lock(Object bean);
+
/**
* Truncate all the given tables.
*/
diff --git a/ebean-api/src/main/java/io/ebean/DbContext.java b/ebean-api/src/main/java/io/ebean/DbContext.java
index 18df2169e..786cfd4bb 100644
--- a/ebean-api/src/main/java/io/ebean/DbContext.java
+++ b/ebean-api/src/main/java/io/ebean/DbContext.java
@@ -115,7 +115,7 @@ final class DbContext {
* Register a server so we can get it by its name.
*/
void register(Database server, boolean isDefault) {
- registerWithName(server.getName(), server, isDefault);
+ registerWithName(server.name(), server, isDefault);
}
private void registerWithName(String name, Database server, boolean isDefault) {
diff --git a/ebean-api/src/main/java/io/ebean/Ebean.java b/ebean-api/src/main/java/io/ebean/Ebean.java
index fb0e34db3..eabc3c5b4 100644
--- a/ebean-api/src/main/java/io/ebean/Ebean.java
+++ b/ebean-api/src/main/java/io/ebean/Ebean.java
@@ -103,7 +103,7 @@ public final class Ebean {
*
*/
public static ExpressionFactory getExpressionFactory() {
- return getDefault().getExpressionFactory();
+ return getDefault().expressionFactory();
}
/**
@@ -642,7 +642,7 @@ public final class Ebean {
* @param id the id value
*/
public static T getReference(Class beanType, Object id) {
- return getDefault().getReference(beanType, id);
+ return getDefault().reference(beanType, id);
}
/**
@@ -1201,14 +1201,14 @@ public final class Ebean {
*
*/
public static BeanState getBeanState(Object bean) {
- return getDefault().getBeanState(bean);
+ return getDefault().beanState(bean);
}
/**
* Return the manager of the server cache ("L2" cache).
*/
public static ServerCacheManager getServerCacheManager() {
- return getDefault().getServerCacheManager();
+ return getDefault().cacheManager();
}
/**
@@ -1216,7 +1216,7 @@ public final class Ebean {
* queries.
*/
public static BackgroundExecutor getBackgroundExecutor() {
- return getDefault().getBackgroundExecutor();
+ return getDefault().backgroundExecutor();
}
/**
diff --git a/ebean-api/src/main/java/io/ebean/Expr.java b/ebean-api/src/main/java/io/ebean/Expr.java
index 01b8f0c49..1316f9873 100644
--- a/ebean-api/src/main/java/io/ebean/Expr.java
+++ b/ebean-api/src/main/java/io/ebean/Expr.java
@@ -16,7 +16,7 @@ import java.util.Map;
* This provides a convenient way to create expressions for the default
* database.
*
- * See also {@link DB#getExpressionFactory()}
+ * See also {@link DB#expressionFactory()}
*
*
* Creates standard common expressions for using in a Query Where or Having
@@ -34,14 +34,14 @@ public class Expr {
* Equal To - property equal to the given value.
*/
public static Expression eq(String propertyName, Object value) {
- return DB.getExpressionFactory().eq(propertyName, value);
+ return DB.expressionFactory().eq(propertyName, value);
}
/**
* Not Equal To - property not equal to the given value.
*/
public static Expression ne(String propertyName, Object value) {
- return DB.getExpressionFactory().ne(propertyName, value);
+ return DB.expressionFactory().ne(propertyName, value);
}
/**
@@ -49,7 +49,7 @@ public class Expr {
* using a lower() function to make it case insensitive).
*/
public static Expression ieq(String propertyName, String value) {
- return DB.getExpressionFactory().ieq(propertyName, value);
+ return DB.expressionFactory().ieq(propertyName, value);
}
/**
@@ -59,28 +59,28 @@ public class Expr {
*
*/
public static Expression inRange(String propertyName, Object value1, Object value2) {
- return DB.getExpressionFactory().inRange(propertyName, value1, value2);
+ return DB.expressionFactory().inRange(propertyName, value1, value2);
}
/**
* Between - property between the two given values.
*/
public static Expression between(String propertyName, Object value1, Object value2) {
- return DB.getExpressionFactory().between(propertyName, value1, value2);
+ return DB.expressionFactory().between(propertyName, value1, value2);
}
/**
* Between - value between two given properties.
*/
public static Expression between(String lowProperty, String highProperty, Object value) {
- return DB.getExpressionFactory().betweenProperties(lowProperty, highProperty, value);
+ return DB.expressionFactory().betweenProperties(lowProperty, highProperty, value);
}
/**
* Greater Than - property greater than the given value.
*/
public static Expression gt(String propertyName, Object value) {
- return DB.getExpressionFactory().gt(propertyName, value);
+ return DB.expressionFactory().gt(propertyName, value);
}
/**
@@ -88,42 +88,42 @@ public class Expr {
* value.
*/
public static Expression ge(String propertyName, Object value) {
- return DB.getExpressionFactory().ge(propertyName, value);
+ return DB.expressionFactory().ge(propertyName, value);
}
/**
* Less Than - property less than the given value.
*/
public static Expression lt(String propertyName, Object value) {
- return DB.getExpressionFactory().lt(propertyName, value);
+ return DB.expressionFactory().lt(propertyName, value);
}
/**
* Less Than or Equal to - property less than or equal to the given value.
*/
public static Expression le(String propertyName, Object value) {
- return DB.getExpressionFactory().le(propertyName, value);
+ return DB.expressionFactory().le(propertyName, value);
}
/**
* Is Null - property is null.
*/
public static Expression isNull(String propertyName) {
- return DB.getExpressionFactory().isNull(propertyName);
+ return DB.expressionFactory().isNull(propertyName);
}
/**
* Is Not Null - property is not null.
*/
public static Expression isNotNull(String propertyName) {
- return DB.getExpressionFactory().isNotNull(propertyName);
+ return DB.expressionFactory().isNotNull(propertyName);
}
/**
* Case insensitive {@link #exampleLike(Object)}
*/
public static ExampleExpression iexampleLike(Object example) {
- return DB.getExpressionFactory().iexampleLike(example);
+ return DB.expressionFactory().iexampleLike(example);
}
/**
@@ -131,14 +131,14 @@ public class Expr {
* LikeType.RAW (you need to add you own wildcards % and _).
*/
public static ExampleExpression exampleLike(Object example) {
- return DB.getExpressionFactory().exampleLike(example);
+ return DB.expressionFactory().exampleLike(example);
}
/**
* Create the query by Example expression specifying more options.
*/
public static ExampleExpression exampleLike(Object example, boolean caseInsensitive, LikeType likeType) {
- return DB.getExpressionFactory().exampleLike(example, caseInsensitive, likeType);
+ return DB.expressionFactory().exampleLike(example, caseInsensitive, likeType);
}
/**
@@ -146,7 +146,7 @@ public class Expr {
* characters % (percentage) and _ (underscore).
*/
public static Expression like(String propertyName, String value) {
- return DB.getExpressionFactory().like(propertyName, value);
+ return DB.expressionFactory().like(propertyName, value);
}
/**
@@ -155,14 +155,14 @@ public class Expr {
* a lower() function to make the expression case insensitive.
*/
public static Expression ilike(String propertyName, String value) {
- return DB.getExpressionFactory().ilike(propertyName, value);
+ return DB.expressionFactory().ilike(propertyName, value);
}
/**
* Starts With - property like value%.
*/
public static Expression startsWith(String propertyName, String value) {
- return DB.getExpressionFactory().startsWith(propertyName, value);
+ return DB.expressionFactory().startsWith(propertyName, value);
}
/**
@@ -170,14 +170,14 @@ public class Expr {
* lower() function to make the expression case insensitive.
*/
public static Expression istartsWith(String propertyName, String value) {
- return DB.getExpressionFactory().istartsWith(propertyName, value);
+ return DB.expressionFactory().istartsWith(propertyName, value);
}
/**
* Ends With - property like %value.
*/
public static Expression endsWith(String propertyName, String value) {
- return DB.getExpressionFactory().endsWith(propertyName, value);
+ return DB.expressionFactory().endsWith(propertyName, value);
}
/**
@@ -185,14 +185,14 @@ public class Expr {
* function to make the expression case insensitive.
*/
public static Expression iendsWith(String propertyName, String value) {
- return DB.getExpressionFactory().iendsWith(propertyName, value);
+ return DB.expressionFactory().iendsWith(propertyName, value);
}
/**
* Contains - property like %value%.
*/
public static Expression contains(String propertyName, String value) {
- return DB.getExpressionFactory().contains(propertyName, value);
+ return DB.expressionFactory().contains(propertyName, value);
}
/**
@@ -200,42 +200,42 @@ public class Expr {
* function to make the expression case insensitive.
*/
public static Expression icontains(String propertyName, String value) {
- return DB.getExpressionFactory().icontains(propertyName, value);
+ return DB.expressionFactory().icontains(propertyName, value);
}
/**
* For collection properties that are empty (have not existing elements).
*/
public static Expression isEmpty(String propertyName) {
- return DB.getExpressionFactory().isEmpty(propertyName);
+ return DB.expressionFactory().isEmpty(propertyName);
}
/**
* For collection properties that are not empty (have existing elements).
*/
public static Expression isNotEmpty(String propertyName) {
- return DB.getExpressionFactory().isNotEmpty(propertyName);
+ return DB.expressionFactory().isNotEmpty(propertyName);
}
/**
* In - property has a value in the array of values.
*/
public static Expression in(String propertyName, Object[] values) {
- return DB.getExpressionFactory().in(propertyName, values);
+ return DB.expressionFactory().in(propertyName, values);
}
/**
* In - using a subQuery.
*/
public static Expression in(String propertyName, Query> subQuery) {
- return DB.getExpressionFactory().in(propertyName, subQuery);
+ return DB.expressionFactory().in(propertyName, subQuery);
}
/**
* In - property has a value in the collection of values.
*/
public static Expression in(String propertyName, Collection> values) {
- return DB.getExpressionFactory().in(propertyName, values);
+ return DB.expressionFactory().in(propertyName, values);
}
/**
@@ -272,14 +272,14 @@ public class Expr {
* }
*/
public static Expression inOrEmpty(String propertyName, Collection> values) {
- return DB.getExpressionFactory().inOrEmpty(propertyName, values);
+ return DB.expressionFactory().inOrEmpty(propertyName, values);
}
/**
* Id Equal to - ID property is equal to the value.
*/
public static Expression idEq(Object value) {
- return DB.getExpressionFactory().idEq(value);
+ return DB.expressionFactory().idEq(value);
}
/**
@@ -292,7 +292,7 @@ public class Expr {
* @param propertyMap a map keyed by property names.
*/
public static Expression allEq(Map propertyMap) {
- return DB.getExpressionFactory().allEq(propertyMap);
+ return DB.expressionFactory().allEq(propertyMap);
}
/**
@@ -303,7 +303,7 @@ public class Expr {
*
*/
public static Expression raw(String raw, Object value) {
- return DB.getExpressionFactory().raw(raw, value);
+ return DB.expressionFactory().raw(raw, value);
}
/**
@@ -314,53 +314,48 @@ public class Expr {
*
*/
public static Expression raw(String raw, Object[] values) {
- return DB.getExpressionFactory().raw(raw, values);
+ return DB.expressionFactory().raw(raw, values);
}
/**
* Add raw expression with no parameters.
*/
public static Expression raw(String raw) {
- return DB.getExpressionFactory().raw(raw);
+ return DB.expressionFactory().raw(raw);
}
/**
* And - join two expressions with a logical and.
*/
public static Expression and(Expression expOne, Expression expTwo) {
-
- return DB.getExpressionFactory().and(expOne, expTwo);
+ return DB.expressionFactory().and(expOne, expTwo);
}
/**
* Or - join two expressions with a logical or.
*/
public static Expression or(Expression expOne, Expression expTwo) {
-
- return DB.getExpressionFactory().or(expOne, expTwo);
+ return DB.expressionFactory().or(expOne, expTwo);
}
/**
* Negate the expression (prefix it with NOT).
*/
public static Expression not(Expression exp) {
-
- return DB.getExpressionFactory().not(exp);
+ return DB.expressionFactory().not(exp);
}
/**
* Return a list of expressions that will be joined by AND's.
*/
public static Junction conjunction(Query query) {
-
- return DB.getExpressionFactory().conjunction(query);
+ return DB.expressionFactory().conjunction(query);
}
/**
* Return a list of expressions that will be joined by OR's.
*/
public static Junction disjunction(Query query) {
-
- return DB.getExpressionFactory().disjunction(query);
+ return DB.expressionFactory().disjunction(query);
}
}
diff --git a/ebean-api/src/main/java/io/ebean/Finder.java b/ebean-api/src/main/java/io/ebean/Finder.java
index 3c9318e7d..cc5ef87f6 100644
--- a/ebean-api/src/main/java/io/ebean/Finder.java
+++ b/ebean-api/src/main/java/io/ebean/Finder.java
@@ -137,11 +137,11 @@ public class Finder {
/**
* Creates an entity reference for this ID.
*
- * Equivalent to {@link Database#getReference(Class, Object)}
+ * Equivalent to {@link Database#reference(Class, Object)}
*/
@Nonnull
public T ref(I id) {
- return db().getReference(type, id);
+ return db().reference(type, id);
}
/**
diff --git a/ebean-api/src/main/java/io/ebean/Transaction.java b/ebean-api/src/main/java/io/ebean/Transaction.java
index 0856a6e4e..06f6bd315 100644
--- a/ebean-api/src/main/java/io/ebean/Transaction.java
+++ b/ebean-api/src/main/java/io/ebean/Transaction.java
@@ -538,7 +538,15 @@ public interface Transaction extends AutoCloseable {
* Examples of when a developer may wish to use the connection directly are:
* Savepoints, advanced CLOB BLOB use and advanced stored procedure calls.
*/
- Connection getConnection();
+ Connection connection();
+
+ /**
+ * Deprecated migrate to connection().
+ */
+ @Deprecated
+ default Connection getConnection() {
+ return connection();
+ }
/**
* Add table modification information to the TransactionEvent.
diff --git a/ebean-api/src/main/java/io/ebean/bean/BeanCollectionLoader.java b/ebean-api/src/main/java/io/ebean/bean/BeanCollectionLoader.java
index 2f0e2848d..b7dc32034 100644
--- a/ebean-api/src/main/java/io/ebean/bean/BeanCollectionLoader.java
+++ b/ebean-api/src/main/java/io/ebean/bean/BeanCollectionLoader.java
@@ -11,7 +11,7 @@ public interface BeanCollectionLoader {
/**
* Return the name of the associated Database.
*/
- String getName();
+ String name();
/**
* Invoke the lazy loading for this bean collection.
diff --git a/ebean-api/src/main/java/io/ebean/bean/EntityBeanIntercept.java b/ebean-api/src/main/java/io/ebean/bean/EntityBeanIntercept.java
index 9924bf4f7..3725cc73c 100644
--- a/ebean-api/src/main/java/io/ebean/bean/EntityBeanIntercept.java
+++ b/ebean-api/src/main/java/io/ebean/bean/EntityBeanIntercept.java
@@ -843,7 +843,7 @@ public final class EntityBeanIntercept implements Serializable {
}
// For stand alone reference bean or after deserialisation lazy load
// using the ebeanServer. Synchronise only on the bean.
- loadBeanInternal(loadProperty, database.getPluginApi().beanLoader());
+ loadBeanInternal(loadProperty, database.pluginApi().beanLoader());
return;
}
} finally {
diff --git a/ebean-api/src/main/java/io/ebean/bean/SingleBeanLoader.java b/ebean-api/src/main/java/io/ebean/bean/SingleBeanLoader.java
index ad4a30b95..73f3fe5d8 100644
--- a/ebean-api/src/main/java/io/ebean/bean/SingleBeanLoader.java
+++ b/ebean-api/src/main/java/io/ebean/bean/SingleBeanLoader.java
@@ -20,7 +20,7 @@ public abstract class SingleBeanLoader implements BeanLoader {
@Override
public String getName() {
- return database.getName();
+ return database.name();
}
@Override
@@ -39,7 +39,7 @@ public abstract class SingleBeanLoader implements BeanLoader {
@Override
public void loadBean(EntityBeanIntercept ebi) {
- database.getPluginApi().loadBeanL2(ebi);
+ database.pluginApi().loadBeanL2(ebi);
}
}
@@ -53,7 +53,7 @@ public abstract class SingleBeanLoader implements BeanLoader {
@Override
public void loadBean(EntityBeanIntercept ebi) {
- database.getPluginApi().loadBeanRef(ebi);
+ database.pluginApi().loadBeanRef(ebi);
}
}
@@ -67,7 +67,7 @@ public abstract class SingleBeanLoader implements BeanLoader {
@Override
public void loadBean(EntityBeanIntercept ebi) {
- database.getPluginApi().loadBean(ebi);
+ database.pluginApi().loadBean(ebi);
}
}
}
diff --git a/ebean-api/src/main/java/io/ebean/cache/QueryCacheEntry.java b/ebean-api/src/main/java/io/ebean/cache/QueryCacheEntry.java
index 31f1134d9..9c07e3574 100644
--- a/ebean-api/src/main/java/io/ebean/cache/QueryCacheEntry.java
+++ b/ebean-api/src/main/java/io/ebean/cache/QueryCacheEntry.java
@@ -13,9 +13,7 @@ import java.util.Set;
public class QueryCacheEntry {
private final Object value;
-
private final Set dependentTables;
-
private final long timestamp;
/**
diff --git a/ebean-api/src/main/java/io/ebean/cache/ServerCache.java b/ebean-api/src/main/java/io/ebean/cache/ServerCache.java
index 82bd452b0..1476e567d 100644
--- a/ebean-api/src/main/java/io/ebean/cache/ServerCache.java
+++ b/ebean-api/src/main/java/io/ebean/cache/ServerCache.java
@@ -10,17 +10,17 @@ import java.util.Set;
* Represents part of the "L2" server side cache.
*
* This is used to cache beans or query results (bean collections).
- *
*
* There are 2 ServerCache's for each bean type. One is used as the 'bean cache'
* which holds beans of a given type. The other is the 'query cache' holding
* query results for a given type.
- *
*/
public interface ServerCache {
+ /**
+ * Get values for many keys.
+ */
default Map
*/
- boolean isLocalL2Caching();
+ boolean localL2Caching();
+
+ /**
+ * Deprecated migrate to localL2Caching().
+ */
+ @Deprecated
+ default boolean isLocalL2Caching() {
+ return localL2Caching();
+ }
/**
* Return all the cache regions.
@@ -36,37 +44,78 @@ public interface ServerCacheManager {
*
* @param regions A region name or comma delimited list of region names.
*/
- void setEnabledRegions(String regions);
+ void enabledRegions(String regions);
+
+ /**
+ * Deprecated migrate to enabledRegions().
+ */
+ @Deprecated
+ default void setEnabledRegions(String regions) {
+ enabledRegions(regions);
+ }
/**
* Enable or disable all the cache regions.
*/
- void setAllRegionsEnabled(boolean enabled);
+ void allRegionsEnabled(boolean enabled);
/**
- * Return the cache region by name. Typically to enable or disable the region.
+ * Deprecated migrate to allRegionsEnabled().
*/
- ServerCacheRegion getRegion(String name);
+ @Deprecated
+ default void setAllRegionsEnabled(boolean enabled) {
+ allRegionsEnabled(enabled);
+ }
+
+ /**
+ * Return the cache region by name. Typically, to enable or disable the region.
+ */
+ ServerCacheRegion region(String name);
+
+ @Deprecated
+ default ServerCacheRegion getRegion(String name) {
+ return region(name);
+ }
/**
* Return the cache for mapping natural keys to id values.
*/
- ServerCache getNaturalKeyCache(Class> beanType);
+ ServerCache naturalKeyCache(Class> beanType);
+
+ @Deprecated
+ default ServerCache getNaturalKeyCache(Class> beanType) {
+ return naturalKeyCache(beanType);
+ }
/**
* Return the cache for beans of a particular type.
*/
- ServerCache getBeanCache(Class> beanType);
+ ServerCache beanCache(Class> beanType);
+
+ @Deprecated
+ default ServerCache getBeanCache(Class> beanType) {
+ return beanCache(beanType);
+ }
/**
* Return the cache for associated many properties of a bean type.
*/
- ServerCache getCollectionIdsCache(Class> beanType, String propertyName);
+ ServerCache collectionIdsCache(Class> beanType, String propertyName);
+
+ @Deprecated
+ default ServerCache getCollectionIdsCache(Class> beanType, String propertyName) {
+ return collectionIdsCache(beanType, propertyName);
+ }
/**
* Return the cache for query results of a particular type of bean.
*/
- ServerCache getQueryCache(Class> beanType);
+ ServerCache queryCache(Class> beanType);
+
+ @Deprecated
+ default ServerCache getQueryCache(Class> beanType) {
+ return queryCache(beanType);
+ }
/**
* This clears both the bean and query cache for a given type.
diff --git a/ebean-api/src/main/java/io/ebean/cache/ServerCacheOptions.java b/ebean-api/src/main/java/io/ebean/cache/ServerCacheOptions.java
index fe8fdb486..c455286ea 100644
--- a/ebean-api/src/main/java/io/ebean/cache/ServerCacheOptions.java
+++ b/ebean-api/src/main/java/io/ebean/cache/ServerCacheOptions.java
@@ -18,7 +18,6 @@ public class ServerCacheOptions {
* Construct with no set options.
*/
public ServerCacheOptions() {
-
}
/**
@@ -73,7 +72,6 @@ public class ServerCacheOptions {
* Return a copy of this object.
*/
public ServerCacheOptions copy() {
-
ServerCacheOptions copy = new ServerCacheOptions();
copy.maxSize = maxSize;
copy.maxIdleSecs = maxIdleSecs;
diff --git a/ebean-api/src/main/java/io/ebean/cache/ServerCacheRegion.java b/ebean-api/src/main/java/io/ebean/cache/ServerCacheRegion.java
index b63668d91..c798b5a35 100644
--- a/ebean-api/src/main/java/io/ebean/cache/ServerCacheRegion.java
+++ b/ebean-api/src/main/java/io/ebean/cache/ServerCacheRegion.java
@@ -8,7 +8,15 @@ public interface ServerCacheRegion {
/**
* Return the region name.
*/
- String getName();
+ String name();
+
+ /**
+ * Deprecated migrate to name().
+ */
+ @Deprecated
+ default String getName() {
+ return name();
+ }
/**
* Return true if the cache region is enabled.
diff --git a/ebean-api/src/main/java/io/ebean/common/AbstractBeanCollection.java b/ebean-api/src/main/java/io/ebean/common/AbstractBeanCollection.java
index 809ca13b3..912d9582f 100644
--- a/ebean-api/src/main/java/io/ebean/common/AbstractBeanCollection.java
+++ b/ebean-api/src/main/java/io/ebean/common/AbstractBeanCollection.java
@@ -63,7 +63,7 @@ abstract class AbstractBeanCollection implements BeanCollection {
*/
AbstractBeanCollection(BeanCollectionLoader loader, EntityBean ownerBean, String propertyName) {
this.loader = loader;
- this.ebeanServerName = loader.getName();
+ this.ebeanServerName = loader.name();
this.ownerBean = ownerBean;
this.propertyName = propertyName;
this.readOnly = ownerBean != null && ownerBean._ebean_getIntercept().isReadOnly();
@@ -111,7 +111,7 @@ abstract class AbstractBeanCollection implements BeanCollection {
public void setLoader(BeanCollectionLoader loader) {
this.registeredWithLoadContext = true;
this.loader = loader;
- this.ebeanServerName = loader.getName();
+ this.ebeanServerName = loader.name();
}
@Override
diff --git a/ebean-api/src/main/java/io/ebean/config/dbplatform/SimpleSequenceIdGenerator.java b/ebean-api/src/main/java/io/ebean/config/dbplatform/SimpleSequenceIdGenerator.java
index 95ee33894..e028aaa3a 100644
--- a/ebean-api/src/main/java/io/ebean/config/dbplatform/SimpleSequenceIdGenerator.java
+++ b/ebean-api/src/main/java/io/ebean/config/dbplatform/SimpleSequenceIdGenerator.java
@@ -61,7 +61,7 @@ public class SimpleSequenceIdGenerator implements PlatformIdGenerator {
PreparedStatement pstmt = null;
ResultSet rset = null;
try {
- c = useTxnConnection ? t.getConnection() : dataSource.getConnection();
+ c = useTxnConnection ? t.connection() : dataSource.getConnection();
pstmt = c.prepareStatement(sql);
rset = pstmt.executeQuery();
if (rset.next()) {
diff --git a/ebean-api/src/main/java/io/ebean/event/BeanDeleteIdRequest.java b/ebean-api/src/main/java/io/ebean/event/BeanDeleteIdRequest.java
index 795886830..66831b69e 100644
--- a/ebean-api/src/main/java/io/ebean/event/BeanDeleteIdRequest.java
+++ b/ebean-api/src/main/java/io/ebean/event/BeanDeleteIdRequest.java
@@ -1,5 +1,6 @@
package io.ebean.event;
+import io.ebean.Database;
import io.ebean.EbeanServer;
import io.ebean.Transaction;
@@ -9,18 +10,62 @@ import io.ebean.Transaction;
public interface BeanDeleteIdRequest {
/**
- * Return the server processing the request.
+ * 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 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> 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();
+ }
}
diff --git a/ebean-api/src/main/java/io/ebean/event/BeanPersistRequest.java b/ebean-api/src/main/java/io/ebean/event/BeanPersistRequest.java
index c5043fb74..57930a107 100644
--- a/ebean-api/src/main/java/io/ebean/event/BeanPersistRequest.java
+++ b/ebean-api/src/main/java/io/ebean/event/BeanPersistRequest.java
@@ -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 {
/**
- * 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 getLoadedProperties();
+ Set loadedProperties();
+
+ /**
+ * Deprecated migrate to loadedProperties().
+ */
+ @Deprecated
+ default Set getLoadedProperties() {
+ return loadedProperties();
+ }
/**
* For an update this is the set of properties that where updated.
@@ -39,12 +64,28 @@ public interface BeanPersistRequest {
* should be preferred if it satisfies the requirement.
*
*/
- Set getUpdatedProperties();
+ Set updatedProperties();
+
+ /**
+ * Deprecated migrate to updatedProperties().
+ */
+ @Deprecated
+ default Set 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 {
/**
* 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 getUpdatedValues();
+ Map updatedValues();
+
+ /**
+ * Deprecated migrate to updatedValues().
+ */
+ @Deprecated
+ default Map getUpdatedValues() {
+ return updatedValues();
+ }
}
diff --git a/ebean-api/src/main/java/io/ebean/event/BeanQueryRequest.java b/ebean-api/src/main/java/io/ebean/event/BeanQueryRequest.java
index 4c13aee54..a8f2b7a29 100644
--- a/ebean-api/src/main/java/io/ebean/event/BeanQueryRequest.java
+++ b/ebean-api/src/main/java/io/ebean/event/BeanQueryRequest.java
@@ -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 {
/**
- * 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 getQuery();
+ Query query();
+
+ /**
+ * Deprecated migrate to query().
+ */
+ @Deprecated
+ default Query getQuery() {
+ return query();
+ }
/**
* Return true if an Id IN expression should have the bind parameters padded.
diff --git a/ebean-api/src/main/java/io/ebean/event/BulkTableEvent.java b/ebean-api/src/main/java/io/ebean/event/BulkTableEvent.java
index a10168cf5..d37743303 100644
--- a/ebean-api/src/main/java/io/ebean/event/BulkTableEvent.java
+++ b/ebean-api/src/main/java/io/ebean/event/BulkTableEvent.java
@@ -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.
diff --git a/ebean-api/src/main/java/io/ebean/metric/QueryPlanMetric.java b/ebean-api/src/main/java/io/ebean/metric/QueryPlanMetric.java
index edc2aaf03..07a9ca6d2 100644
--- a/ebean-api/src/main/java/io/ebean/metric/QueryPlanMetric.java
+++ b/ebean-api/src/main/java/io/ebean/metric/QueryPlanMetric.java
@@ -10,7 +10,15 @@ public interface QueryPlanMetric {
/**
* Return the underlying timed metric.
*/
- TimedMetric getMetric();
+ TimedMetric metric();
+
+ /**
+ * Deprecated migrate to metric().
+ */
+ @Deprecated
+ default TimedMetric getMetric() {
+ return metric();
+ }
/**
* Visit the underlying metric.
diff --git a/ebean-api/src/main/java/io/ebean/plugin/BeanDocType.java b/ebean-api/src/main/java/io/ebean/plugin/BeanDocType.java
index 92b3d6d19..77a8f72d9 100644
--- a/ebean-api/src/main/java/io/ebean/plugin/BeanDocType.java
+++ b/ebean-api/src/main/java/io/ebean/plugin/BeanDocType.java
@@ -16,11 +16,27 @@ public interface BeanDocType {
/**
* Return the doc store index type for this bean type.
*/
+ default String indexType() {
+ return getIndexType();
+ }
+
+ /**
+ * Deprecated migrate to indexType().
+ */
+ @Deprecated
String getIndexType();
/**
* Return the doc store index name for this bean type.
*/
+ default String indexName() {
+ return getIndexName();
+ }
+
+ /**
+ * Deprecated migrate to indexName().
+ */
+ @Deprecated
String getIndexName();
/**
@@ -32,12 +48,28 @@ public interface BeanDocType {
/**
* Return the FetchPath for the embedded document.
*/
+ default FetchPath embedded(String path) {
+ return getEmbedded(path);
+ }
+
+ /**
+ * Deprecated migrate to embedded().
+ */
+ @Deprecated
FetchPath getEmbedded(String path);
/**
* For embedded 'many' properties we need a FetchPath relative to the root which is used to
* build and replace the embedded list.
*/
+ default FetchPath embeddedManyRoot(String path) {
+ return getEmbeddedManyRoot(path);
+ }
+
+ /**
+ * Deprecated migrate to embeddedManyRoot().
+ */
+ @Deprecated
FetchPath getEmbeddedManyRoot(String path);
/**
diff --git a/ebean-api/src/main/java/io/ebean/plugin/BeanType.java b/ebean-api/src/main/java/io/ebean/plugin/BeanType.java
index e44474cd3..661b370d2 100644
--- a/ebean-api/src/main/java/io/ebean/plugin/BeanType.java
+++ b/ebean-api/src/main/java/io/ebean/plugin/BeanType.java
@@ -22,24 +22,56 @@ public interface BeanType {
* Return the short name of the bean type.
*/
@Nonnull
- String getName();
+ String name();
+
+ /**
+ * Deprecated migrate to name().
+ */
+ @Deprecated
+ default String getName() {
+ return name();
+ }
/**
* Return the full name of the bean type.
*/
@Nonnull
- String getFullName();
+ String fullName();
+
+ /**
+ * Deprecated migrate to fullName().
+ */
+ @Deprecated
+ default String getFullName() {
+ return fullName();
+ }
/**
* Return the class type this BeanDescriptor describes.
*/
@Nonnull
- Class getBeanType();
+ Class type();
+
+ /**
+ * Deprecated migrate to type().
+ */
+ @Deprecated
+ default Class getBeanType() {
+ return type();
+ }
/**
* Return the type bean for an OneToMany or ManyToOne or ManyToMany property.
*/
- BeanType> getBeanTypeAtPath(String propertyName);
+ BeanType> beanTypeAtPath(String propertyName);
+
+ /**
+ * Deprecated migrate to beanTypeAtPath().
+ */
+ @Deprecated
+ default BeanType> getBeanTypeAtPath(String propertyName) {
+ return beanTypeAtPath(propertyName);
+ }
/**
* Return all the properties for this bean type.
@@ -50,22 +82,54 @@ public interface BeanType {
/**
* Return the Id property.
*/
- Property getIdProperty();
+ Property idProperty();
+
+ /**
+ * Deprecated migrate to idProperty().
+ */
+ @Deprecated
+ default Property getIdProperty() {
+ return idProperty();
+ }
/**
* Return the when modified property if there is one defined.
*/
- Property getWhenModifiedProperty();
+ Property whenModifiedProperty();
+
+ /**
+ * Deprecated migrate to idProperty().
+ */
+ @Deprecated
+ default Property getWhenModifiedProperty() {
+ return whenModifiedProperty();
+ }
/**
* Return the when created property if there is one defined.
*/
- Property getWhenCreatedProperty();
+ Property whenCreatedProperty();
+
+ /**
+ * Deprecated migrate to idProperty().
+ */
+ @Deprecated
+ default Property getWhenCreatedProperty() {
+ return whenCreatedProperty();
+ }
/**
* Return the Property to read values from a bean.
*/
- Property getProperty(String propertyName);
+ Property property(String propertyName);
+
+ /**
+ * Deprecated migrate to property().
+ */
+ @Deprecated
+ default Property getProperty(String propertyName) {
+ return property(propertyName);
+ }
/**
* Return the ExpressionPath for a given property path.
@@ -73,7 +137,15 @@ public interface BeanType {
* This can return a property or nested property path.
*
*/
- ExpressionPath getExpressionPath(String path);
+ ExpressionPath expressionPath(String path);
+
+ /**
+ * Deprecated migrate to expressionPath().
+ */
+ @Deprecated
+ default ExpressionPath getExpressionPath(String path) {
+ return expressionPath(path);
+ }
/**
* Return true if the property is a valid known property or path for the given bean type.
@@ -108,7 +180,15 @@ public interface BeanType {
/**
* Return the base table this bean type maps to.
*/
- String getBaseTable();
+ String baseTable();
+
+ /**
+ * Deprecated migrate to baseTable().
+ */
+ @Deprecated
+ default String getBaseTable() {
+ return baseTable();
+ }
/**
* Create a new instance of the bean.
@@ -118,42 +198,99 @@ public interface BeanType {
/**
* Return the bean id. This is the same as getBeanId() but without the generic type.
*/
- Object beanId(Object bean);
+ Object id(Object bean);
/**
- * Return the id value for the given bean.
+ * Deprecated migrate to id()
*/
+ @Deprecated
+ default Object beanId(Object bean) {
+ return id(bean);
+ }
+
+ /**
+ * Deprecated migrate to id()
+ */
+ @Deprecated
Object getBeanId(T bean);
/**
* Set the id value to the bean.
*/
- void setBeanId(T bean, Object idValue);
+ void setId(T bean, Object idValue);
+
+ /**
+ * Deprecated migrate to setId()
+ */
+ @Deprecated
+ default void setBeanId(T bean, Object idValue) {
+ setId(bean, idValue);
+ }
/**
* Return the bean persist controller.
*/
- BeanPersistController getPersistController();
+ BeanPersistController persistController();
+
+ /**
+ * Deprecated migrate to persistController()
+ */
+ @Deprecated
+ default BeanPersistController getPersistController() {
+ return persistController();
+ }
/**
* Return the bean persist listener.
*/
- BeanPersistListener getPersistListener();
+ BeanPersistListener persistListener();
+
+ /**
+ * Deprecated migrate to persistListener()
+ */
+ @Deprecated
+ default BeanPersistListener getPersistListener() {
+ return persistListener();
+ }
/**
* Return the beanFinder. Usually null unless overriding the finder.
*/
- BeanFindController getFindController();
+ BeanFindController findController();
+
+ /**
+ * Deprecated migrate to findController()
+ */
+ @Deprecated
+ default BeanFindController getFindController() {
+ return findController();
+ }
/**
* Return the BeanQueryAdapter or null if none is defined.
*/
- BeanQueryAdapter getQueryAdapter();
+ BeanQueryAdapter queryAdapter();
+
+ /**
+ * Deprecated migrate to queryAdapter()
+ */
+ @Deprecated
+ default BeanQueryAdapter getQueryAdapter() {
+ return queryAdapter();
+ }
/**
* Return the identity generation type.
*/
- IdType getIdType();
+ IdType idType();
+
+ /**
+ * Deprecated migrate to idType()
+ */
+ @Deprecated
+ default IdType getIdType() {
+ return idType();
+ }
/**
* Return true if this bean type has doc store backing.
@@ -167,12 +304,28 @@ public interface BeanType {
* for the document store.
*
*/
- DocMapping getDocMapping();
+ DocMapping docMapping();
+
+ /**
+ * Deprecated migrate to docMapping()
+ */
+ @Deprecated
+ default DocMapping getDocMapping() {
+ return docMapping();
+ }
/**
* Return the doc store queueId for this bean type.
*/
- String getDocStoreQueueId();
+ String docStoreQueueId();
+
+ /**
+ * Deprecated migrate to docStoreQueueId()
+ */
+ @Deprecated
+ default String getDocStoreQueueId() {
+ return docStoreQueueId();
+ }
/**
* Return the doc store support for this bean type.\
@@ -203,12 +356,28 @@ public interface BeanType {
/**
* Returns all direct children of this beantype
*/
- List> getInheritanceChildren();
+ List> inheritanceChildren();
/**
- * Returns the parent in inheritance hiearchy
+ * Deprecated migrate to inheritanceChildren()
*/
- BeanType> getInheritanceParent();
+ @Deprecated
+ default List> getInheritanceChildren() {
+ return inheritanceChildren();
+ }
+
+ /**
+ * Returns the parent in inheritance hierarchy
+ */
+ BeanType> inheritanceParent();
+
+ /**
+ * Deprecated migrate to inheritanceParent()
+ */
+ @Deprecated
+ default BeanType> getInheritanceParent() {
+ return inheritanceParent();
+ }
/**
* Visit all children recursively
@@ -218,7 +387,15 @@ public interface BeanType {
/**
* Return the discriminator column.
*/
- String getDiscColumn();
+ String discColumn();
+
+ /**
+ * Deprecated migrate to discColumn()
+ */
+ @Deprecated
+ default String getDiscColumn() {
+ return discColumn();
+ }
/**
* Create a bean given the discriminator value.
diff --git a/ebean-api/src/main/java/io/ebean/plugin/ExpressionPath.java b/ebean-api/src/main/java/io/ebean/plugin/ExpressionPath.java
index 45de4c66b..b7675f87b 100644
--- a/ebean-api/src/main/java/io/ebean/plugin/ExpressionPath.java
+++ b/ebean-api/src/main/java/io/ebean/plugin/ExpressionPath.java
@@ -37,7 +37,15 @@ public interface ExpressionPath {
/**
* Return the default StringParser for the scalar property.
*/
- StringParser getStringParser();
+ StringParser stringParser();
+
+ /**
+ * Deprecated migrate to stringParser().
+ */
+ @Deprecated
+ default StringParser getStringParser() {
+ return stringParser();
+ }
/**
* For DateTime capable scalar types convert the long systemTimeMillis into
@@ -54,7 +62,15 @@ public interface ExpressionPath {
/**
* Return the underlying JDBC type or 0 if this is not a scalar type.
*/
- int getJdbcType();
+ int jdbcType();
+
+ /**
+ * Deprecated migrate to jdbcType().
+ */
+ @Deprecated
+ default int getJdbcType() {
+ return jdbcType();
+ }
/**
* Return true if this is an ManyToOne or OneToOne associated bean property.
@@ -67,20 +83,52 @@ public interface ExpressionPath {
* Typically used to produce id = ? expression strings.
*
*/
- String getAssocIdExpression(String propName, String bindOperator);
+ String assocIdExpression(String propName, String bindOperator);
+
+ /**
+ * Deprecated migrate to assocIdExpression().
+ */
+ @Deprecated
+ default String getAssocIdExpression(String propName, String bindOperator) {
+ return assocIdExpression(propName, bindOperator);
+ }
/**
* Return the Id values for the given bean value.
*/
- Object[] getAssocIdValues(EntityBean bean);
+ Object[] assocIdValues(EntityBean bean);
+
+ /**
+ * Deprecated migrate to assocIdValues().
+ */
+ @Deprecated
+ default Object[] getAssocIdValues(EntityBean bean) {
+ return assocIdValues(bean);
+ }
/**
* Return the underlying bean property.
*/
- Property getProperty();
+ Property property();
+
+ /**
+ * Deprecated migrate to property().
+ */
+ @Deprecated
+ default Property getProperty() {
+ return property();
+ }
/**
* The ElPrefix plus name.
*/
- String getElName();
+ String elName();
+
+ /**
+ * Deprecated migrate to elName().
+ */
+ @Deprecated
+ default String getElName() {
+ return elName();
+ }
}
diff --git a/ebean-api/src/main/java/io/ebean/plugin/Property.java b/ebean-api/src/main/java/io/ebean/plugin/Property.java
index 20d81d7e5..50a1ebc3d 100644
--- a/ebean-api/src/main/java/io/ebean/plugin/Property.java
+++ b/ebean-api/src/main/java/io/ebean/plugin/Property.java
@@ -11,18 +11,42 @@ public interface Property {
* Return the name of the property.
*/
@Nonnull
- String getName();
+ String name();
+
+ /**
+ * Deprecated migrate to name().
+ */
+ @Deprecated
+ default String getName() {
+ return name();
+ }
/**
* Return the type of the property.
*/
@Nonnull
- Class> getPropertyType();
+ Class> type();
+
+ /**
+ * Deprecated migrate to type().
+ */
+ @Deprecated
+ default Class> getPropertyType() {
+ return type();
+ }
/**
* Return the value of the property on the given bean.
*/
- Object getVal(Object bean);
+ Object value(Object bean);
+
+ /**
+ * Deprecated migrate to value().
+ */
+ @Deprecated
+ default Object getVal(Object bean) {
+ return value(bean);
+ }
/**
* Return true if this is a OneToMany or ManyToMany property.
diff --git a/ebean-api/src/main/java/io/ebean/plugin/SpiServer.java b/ebean-api/src/main/java/io/ebean/plugin/SpiServer.java
index 257829a5e..96bf6eed1 100644
--- a/ebean-api/src/main/java/io/ebean/plugin/SpiServer.java
+++ b/ebean-api/src/main/java/io/ebean/plugin/SpiServer.java
@@ -16,32 +16,80 @@ public interface SpiServer extends Database {
/**
* Return the DatabaseConfig.
*/
- DatabaseConfig getServerConfig();
+ DatabaseConfig config();
+
+ /**
+ * Migrate to config().
+ */
+ @Deprecated
+ default DatabaseConfig getServerConfig() {
+ return config();
+ }
/**
* Return the DatabasePlatform for this database.
*/
- DatabasePlatform getDatabasePlatform();
+ DatabasePlatform databasePlatform();
+
+ /**
+ * Migrate to config().
+ */
+ @Deprecated
+ default DatabasePlatform getDatabasePlatform() {
+ return databasePlatform();
+ }
/**
* Return all the bean types registered on this server instance.
*/
- List extends BeanType>> getBeanTypes();
+ List extends BeanType>> beanTypes();
+
+ /**
+ * Migrate to beanTypes().
+ */
+ @Deprecated
+ default List extends BeanType>> getBeanTypes() {
+ return beanTypes();
+ }
/**
* Return the bean type for a given entity bean class.
*/
- BeanType getBeanType(Class beanClass);
+ BeanType beanType(Class beanClass);
+
+ /**
+ * Migrate to beanType().
+ */
+ @Deprecated
+ default BeanType getBeanType(Class beanClass) {
+ return beanType(beanClass);
+ }
/**
* Return the bean types mapped to the given base table.
*/
- List extends BeanType>> getBeanTypes(String baseTableName);
+ List extends BeanType>> beanTypes(String baseTableName);
+
+ /**
+ * Migrate to beanTypes().
+ */
+ @Deprecated
+ default List extends BeanType>> getBeanTypes(String baseTableName) {
+ return beanTypes(baseTableName);
+ }
/**
* Return the bean type for a given doc store queueId.
*/
- BeanType> getBeanTypeForQueueId(String queueId);
+ BeanType> beanTypeForQueueId(String queueId);
+
+ /**
+ * Migrate to beanTypes().
+ */
+ @Deprecated
+ default BeanType> getBeanTypeForQueueId(String queueId) {
+ return beanTypeForQueueId(queueId);
+ }
/**
* Return a BeanLoader.
diff --git a/ebean-api/src/test/java/io/ebean/config/dbplatform/DbDefaultValueTest.java b/ebean-api/src/test/java/io/ebean/config/dbplatform/DbDefaultValueTest.java
index 2c94e989a..54c003c9c 100644
--- a/ebean-api/src/test/java/io/ebean/config/dbplatform/DbDefaultValueTest.java
+++ b/ebean-api/src/test/java/io/ebean/config/dbplatform/DbDefaultValueTest.java
@@ -1,6 +1,6 @@
package io.ebean.config.dbplatform;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.sql.Types;
import java.time.LocalDate;
diff --git a/ebean-autotune/pom.xml b/ebean-autotune/pom.xml
index c244053d2..c98444f78 100644
--- a/ebean-autotune/pom.xml
+++ b/ebean-autotune/pom.xml
@@ -4,7 +4,7 @@
ebean-parentio.ebean
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
@@ -14,7 +14,7 @@
scm:git:git@github.com:ebean-orm/ebean.git
- ebean-parent-12.8.0
+ ebean-parent-12.11.4ebean autotune
@@ -26,7 +26,7 @@
io.ebeanebean-core
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTprovided
@@ -46,9 +46,9 @@
- org.avaje.composite
+ io.avajejunit
- 1.1
+ 1.0test
@@ -59,12 +59,12 @@
io.repaint.maventiles-maven-plugin
- 2.19
+ 2.24true
- io.ebean.tile:enhancement:12.6.0
+ io.ebean.tile:enhancement:12.11.3
diff --git a/ebean-autotune/src/main/java/io/ebeaninternal/server/autotune/service/DefaultAutoTuneService.java b/ebean-autotune/src/main/java/io/ebeaninternal/server/autotune/service/DefaultAutoTuneService.java
index be2033695..b8d302f23 100644
--- a/ebean-autotune/src/main/java/io/ebeaninternal/server/autotune/service/DefaultAutoTuneService.java
+++ b/ebean-autotune/src/main/java/io/ebeaninternal/server/autotune/service/DefaultAutoTuneService.java
@@ -59,7 +59,7 @@ public class DefaultAutoTuneService implements AutoTuneService {
this.tuningFile = config.getQueryTuningFile();
this.profilingFile = config.getProfilingFile();
this.profilingUpdateFrequency = config.getProfilingUpdateFrequency();
- this.serverName = server.getName();
+ this.serverName = server.name();
this.profileManager = new ProfileManager(config, server);
this.queryTuner = new BaseQueryTuner(config, server, profileManager);
this.skipGarbageCollectionOnShutdown = config.isSkipGarbageCollectionOnShutdown();
@@ -77,7 +77,7 @@ public class DefaultAutoTuneService implements AutoTuneService {
loadTuningFile();
if (isRuntimeTuningUpdates()) {
// periodically gather and update query tuning
- server.getBackgroundExecutor().scheduleWithFixedDelay(new ProfilingUpdate(), profilingUpdateFrequency, profilingUpdateFrequency, TimeUnit.SECONDS);
+ server.backgroundExecutor().scheduleWithFixedDelay(new ProfilingUpdate(), profilingUpdateFrequency, profilingUpdateFrequency, TimeUnit.SECONDS);
}
}
}
diff --git a/ebean-autotune/src/main/java/io/ebeaninternal/server/autotune/service/ProfileManager.java b/ebean-autotune/src/main/java/io/ebeaninternal/server/autotune/service/ProfileManager.java
index 170a3a406..019955114 100644
--- a/ebean-autotune/src/main/java/io/ebeaninternal/server/autotune/service/ProfileManager.java
+++ b/ebean-autotune/src/main/java/io/ebeaninternal/server/autotune/service/ProfileManager.java
@@ -111,7 +111,7 @@ public class ProfileManager implements ProfilingListener {
public AutoTuneCollection profilingCollection(boolean reset) {
AutoTuneCollection req = new AutoTuneCollection();
for (ProfileOrigin origin : profileMap.values()) {
- BeanDescriptor> desc = server.getBeanDescriptorById(origin.getOrigin().getBeanType());
+ BeanDescriptor> desc = server.descriptorById(origin.getOrigin().getBeanType());
if (desc != null) {
origin.profilingCollection(desc, req, reset);
}
diff --git a/ebean-autotune/src/main/java/io/ebeaninternal/server/autotune/service/ProfileOriginNodeUsage.java b/ebean-autotune/src/main/java/io/ebeaninternal/server/autotune/service/ProfileOriginNodeUsage.java
index 3ba6afa20..1f2a655dc 100644
--- a/ebean-autotune/src/main/java/io/ebeaninternal/server/autotune/service/ProfileOriginNodeUsage.java
+++ b/ebean-autotune/src/main/java/io/ebeaninternal/server/autotune/service/ProfileOriginNodeUsage.java
@@ -43,14 +43,14 @@ public class ProfileOriginNodeUsage {
try {
BeanDescriptor> desc = rootDesc;
if (path != null) {
- ElPropertyValue elGetValue = rootDesc.getElGetValue(path);
+ ElPropertyValue elGetValue = rootDesc.elGetValue(path);
if (elGetValue == null) {
- logger.warn("AutoTune: Can't find join for path[" + path + "] for " + rootDesc.getName());
+ logger.warn("AutoTune: Can't find join for path[" + path + "] for " + rootDesc.name());
return;
} else {
- BeanProperty beanProperty = elGetValue.getBeanProperty();
+ BeanProperty beanProperty = elGetValue.beanProperty();
if (beanProperty instanceof BeanPropertyAssoc>) {
- desc = ((BeanPropertyAssoc>) beanProperty).getTargetDescriptor();
+ desc = ((BeanPropertyAssoc>) beanProperty).targetDescriptor();
}
}
}
@@ -61,7 +61,7 @@ public class ProfileOriginNodeUsage {
for (String propName : aggregateUsed) {
BeanProperty beanProp = desc.findPropertyFromPath(propName);
if (beanProp == null) {
- logger.warn("AutoTune: Can't find property[" + propName + "] for " + desc.getName());
+ logger.warn("AutoTune: Can't find property[" + propName + "] for " + desc.name());
} else {
if (beanProp.isId()) {
@@ -76,24 +76,24 @@ public class ProfileOriginNodeUsage {
// (which is the default for Lob's so typical).
} else {
addedToPath = true;
- pathProps.addToPath(path, beanProp.getName());
+ pathProps.addToPath(path, beanProp.name());
}
}
}
}
if ((modified || addVersionProperty) && desc != null) {
- BeanProperty versionProp = desc.getVersionProperty();
+ BeanProperty versionProp = desc.versionProperty();
if (versionProp != null) {
addedToPath = true;
- pathProps.addToPath(path, versionProp.getName());
+ pathProps.addToPath(path, versionProp.name());
}
}
if (toOneIdProperty != null && !addedToPath) {
// add ToOne property to parent path
- ElPropertyValue assocOne = rootDesc.getElGetValue(path);
- pathProps.addToPath(SplitName.parent(path), assocOne.getName());
+ ElPropertyValue assocOne = rootDesc.elGetValue(path);
+ pathProps.addToPath(SplitName.parent(path), assocOne.name());
}
} finally {
lock.unlock();
diff --git a/ebean-autotune/src/test/java/io/ebeaninternal/server/autotune/service/AutoTuneXmlReaderTest.java b/ebean-autotune/src/test/java/io/ebeaninternal/server/autotune/service/AutoTuneXmlReaderTest.java
index 845e68624..d67f2ec64 100644
--- a/ebean-autotune/src/test/java/io/ebeaninternal/server/autotune/service/AutoTuneXmlReaderTest.java
+++ b/ebean-autotune/src/test/java/io/ebeaninternal/server/autotune/service/AutoTuneXmlReaderTest.java
@@ -1,7 +1,7 @@
package io.ebeaninternal.server.autotune.service;
import io.ebeaninternal.server.autotune.model.Autotune;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.File;
import java.io.InputStream;
diff --git a/ebean-autotune/src/test/java/io/ebeaninternal/server/autotune/service/ProfileOriginTest.java b/ebean-autotune/src/test/java/io/ebeaninternal/server/autotune/service/ProfileOriginTest.java
index b1f982024..9f981a404 100644
--- a/ebean-autotune/src/test/java/io/ebeaninternal/server/autotune/service/ProfileOriginTest.java
+++ b/ebean-autotune/src/test/java/io/ebeaninternal/server/autotune/service/ProfileOriginTest.java
@@ -5,7 +5,7 @@ import io.ebean.bean.ObjectGraphNode;
import io.ebean.bean.ObjectGraphOrigin;
import io.ebeaninternal.server.deploy.BeanDescriptor;
import io.ebeaninternal.server.querydefn.OrmQueryDetail;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.tests.autofetch.BaseTestCase;
import org.tests.model.basic.Order;
diff --git a/ebean-autotune/src/test/java/org/tests/autofetch/BaseTestCase.java b/ebean-autotune/src/test/java/org/tests/autofetch/BaseTestCase.java
index e59dbbb4b..102affc90 100644
--- a/ebean-autotune/src/test/java/org/tests/autofetch/BaseTestCase.java
+++ b/ebean-autotune/src/test/java/org/tests/autofetch/BaseTestCase.java
@@ -11,6 +11,6 @@ public class BaseTestCase {
}
protected BeanDescriptor getBeanDescriptor(Class cls) {
- return spiEbeanServer().getBeanDescriptor(cls);
+ return spiEbeanServer().descriptor(cls);
}
}
diff --git a/ebean-bom/pom.xml b/ebean-bom/pom.xml
index 6468059fe..a21697986 100644
--- a/ebean-bom/pom.xml
+++ b/ebean-bom/pom.xml
@@ -4,7 +4,7 @@
ebean-parentio.ebean
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTebean bom
@@ -71,88 +71,88 @@
io.ebeanebean
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTio.ebeanebean-api
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTio.ebeanebean-core
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTio.ebeanebean-core-type
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTio.ebeanebean-ddl-generator
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTio.ebeanebean-externalmapping-api
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTio.ebeanebean-externalmapping-xml
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTio.ebeanebean-autotune
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTio.ebeanebean-querybean
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTio.ebeanquerybean-generator
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTprovidedio.ebeankotlin-querybean-generator
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTprovidedio.ebeanebean-test
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTtestio.ebeanebean-postgis
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTio.ebeanebean-redis
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
diff --git a/ebean-core-type/pom.xml b/ebean-core-type/pom.xml
index 10c45ea74..512ed0b45 100644
--- a/ebean-core-type/pom.xml
+++ b/ebean-core-type/pom.xml
@@ -4,7 +4,7 @@
ebean-parentio.ebean
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTebean-core-type
@@ -16,7 +16,7 @@
io.ebeanebean-api
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
diff --git a/ebean-core/pom.xml b/ebean-core/pom.xml
index 66eb107fb..b4ae7fb11 100644
--- a/ebean-core/pom.xml
+++ b/ebean-core/pom.xml
@@ -3,7 +3,7 @@
ebean-parentio.ebean
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTebean-core
@@ -15,35 +15,21 @@
scm:git:git@github.com:ebean-orm/ebean.git
- ebean-parent-12.8.0
+ ebean-parent-12.11.4
-
-
- db2
-
-
-
- com.ibm.db2
- jcc
- 11.5.5.0
- test
-
-
-
- io.ebeanebean-ddl-runner
- 1.0
+ 1.1io.avajeclasspath-scanner
- 6.0
+ 6.1
@@ -52,45 +38,22 @@
1.1
-
-
- io.ebean
- ebean-migration
- 12.4.0
- test
-
-
-
- io.ebean
- ebean-ddl-generator
- 12.11.0
- test
-
-
-
-
- org.glassfish.jaxb
- jaxb-runtime
- 2.3.2
- test
-
-
io.ebeanebean-api
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTio.ebeanebean-core-type
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOTio.ebeanebean-externalmapping-api
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
@@ -105,8 +68,8 @@
-->
io.avaje
- avaje-jsr305
- 1.0
+ avaje-jsr305-x
+ 1.1provided
@@ -121,8 +84,8 @@
javax.transaction
- jta
- 1.1
+ javax.transaction-api
+ 1.3true
@@ -130,7 +93,7 @@
javax.validationvalidation-api
- 1.1.0.Final
+ 2.0.1.Finaltrue
@@ -147,12 +110,12 @@
true
-
- javax.annotation
- javax.annotation-api
- 1.3.2
- true
-
+
+
+
+
+
+
@@ -186,107 +149,15 @@
test
-
- com.nuodb.jdbc
- nuodb-jdbc
- 20.2.0
- test
-
-
-
- com.oracle.ojdbc
- ojdbc10
- 19.3.0.0
- test
-
-
-
- io.ebean
- ebean-test-docker
- 4.1
- test
-
-
-
- ch.qos.logback
- logback-classic
- 1.2.3
- test
-
-
-
- org.xerial
- sqlite-jdbc
- 3.15.1
- test
-
-
-
- org.hsqldb
- hsqldb
- 2.3.4
- test
-
-
-
- com.microsoft.sqlserver
- mssql-jdbc
- 7.2.2.jre8
- test
-
-
-
- mysql
- mysql-connector-java
- 8.0.17
- test
-
-
-
- org.mariadb.jdbc
- mariadb-java-client
- 2.6.0
- test
-
-
-
- com.sap.cloud.db.jdbc
- ngdbc
- 2.3.48
- test
-
-
-
- org.mockito
- mockito-core
- 3.0.0
- test
-
-
-
- org.avaje.composite
- junit
- 1.1
- test
-
-
-
- commons-io
- commons-io
- 2.7
- test
-
-
io.avaje
- mod-uuid
- 1.1
+ junit
+ 1.0test
-
diff --git a/ebean-core/src/main/java/io/ebeaninternal/api/LoadBeanBuffer.java b/ebean-core/src/main/java/io/ebeaninternal/api/LoadBeanBuffer.java
index 346da41fd..3b999bc3c 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/api/LoadBeanBuffer.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/api/LoadBeanBuffer.java
@@ -11,15 +11,15 @@ import java.util.List;
*/
public interface LoadBeanBuffer {
- int getBatchSize();
+ int batchSize();
- List getBatch();
+ List batch();
- BeanDescriptor> getBeanDescriptor();
+ BeanDescriptor> descriptor();
- PersistenceContext getPersistenceContext();
+ PersistenceContext persistenceContext();
- String getFullPath();
+ String fullPath();
void configureQuery(SpiQuery> query, String lazyLoadProperty);
diff --git a/ebean-core/src/main/java/io/ebeaninternal/api/LoadBeanRequest.java b/ebean-core/src/main/java/io/ebeaninternal/api/LoadBeanRequest.java
index a763182b2..ffe28462c 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/api/LoadBeanRequest.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/api/LoadBeanRequest.java
@@ -1,7 +1,8 @@
package io.ebeaninternal.api;
-import io.ebean.bean.EntityBean;
+import io.ebean.CacheMode;
import io.ebean.bean.EntityBeanIntercept;
+import io.ebeaninternal.api.SpiQuery.Mode;
import io.ebeaninternal.server.core.OrmQueryRequest;
import io.ebeaninternal.server.deploy.BeanDescriptor;
@@ -19,77 +20,54 @@ public final class LoadBeanRequest extends LoadRequest {
private final LoadBeanBuffer loadBuffer;
private final String lazyLoadProperty;
private final boolean loadCache;
- private boolean loadedFromCache;
+ private final boolean alreadyLoaded;
/**
* Construct for lazy load request.
*/
- public LoadBeanRequest(LoadBeanBuffer LoadBuffer, EntityBeanIntercept ebi, boolean loadCache) {
- this(LoadBuffer, null, true, ebi.getLazyLoadProperty(), loadCache);
- this.loadedFromCache = ebi.isLoadedFromCache();
+ public LoadBeanRequest(LoadBeanBuffer loadBuffer, EntityBeanIntercept ebi, boolean loadCache) {
+ this(loadBuffer, null, true, ebi.getLazyLoadProperty(), ebi.isLoaded(), loadCache || ebi.isLoadedFromCache());
}
/**
* Construct for secondary query.
*/
- public LoadBeanRequest(LoadBeanBuffer LoadBuffer, OrmQueryRequest> parentRequest) {
- this(LoadBuffer, parentRequest, false, null, false);
+ public LoadBeanRequest(LoadBeanBuffer loadBuffer, OrmQueryRequest> parentRequest) {
+ this(loadBuffer, parentRequest, false, null, false, false);
}
private LoadBeanRequest(LoadBeanBuffer loadBuffer, OrmQueryRequest> parentRequest, boolean lazy,
- String lazyLoadProperty, boolean loadCache) {
-
+ String lazyLoadProperty, boolean alreadyLoaded, boolean loadCache) {
super(parentRequest, lazy);
this.loadBuffer = loadBuffer;
- this.batch = loadBuffer.getBatch();
+ this.batch = loadBuffer.batch();
this.lazyLoadProperty = lazyLoadProperty;
+ this.alreadyLoaded = alreadyLoaded;
this.loadCache = loadCache;
}
@Override
- public Class> getBeanType() {
- return loadBuffer.getBeanDescriptor().getBeanType();
+ public Class> beanType() {
+ return loadBuffer.descriptor().type();
}
- /**
- * Return true if the beans invoking lazy loading were previously loaded from cache.
- */
- public boolean isLoadedFromCache() {
- return loadedFromCache;
- }
-
- private boolean isLoadCache() {
- return loadCache;
- }
-
- public String getDescription() {
- return "path:" + loadBuffer.getFullPath() + " batch:" + batch.size();
+ public String description() {
+ return loadBuffer.fullPath();
}
/**
* Return the batch of beans to actually load.
*/
- public List getBatch() {
+ public List batch() {
return batch;
}
- /**
- * Return the load context.
- */
- private LoadBeanBuffer getLoadContext() {
- return loadBuffer;
- }
-
- public int getBatchSize() {
- return getLoadContext().getBatchSize();
- }
-
/**
* Return the list of Id values for the beans in the lazy load buffer.
*/
public List getIdList() {
List idList = new ArrayList<>();
- BeanDescriptor> desc = loadBuffer.getBeanDescriptor();
+ BeanDescriptor> desc = loadBuffer.descriptor();
for (EntityBeanIntercept ebi : batch) {
idList.add(desc.getId(ebi.getOwner()));
}
@@ -100,16 +78,21 @@ public final class LoadBeanRequest extends LoadRequest {
* Configure the query for lazy loading execution.
*/
public void configureQuery(SpiQuery> query, List idList) {
- query.setMode(SpiQuery.Mode.LAZYLOAD_BEAN);
- query.setPersistenceContext(loadBuffer.getPersistenceContext());
- String mode = isLazy() ? "+lazy" : "+query";
- query.setLoadDescription(mode, getDescription());
-
- if (isLazy()) {
- // cascade the batch size (if set) for further lazy loading
- query.setLazyLoadBatchSize(getBatchSize());
+ query.setMode(Mode.LAZYLOAD_BEAN);
+ query.setPersistenceContext(loadBuffer.persistenceContext());
+ query.setLoadDescription(lazy ? "+lazy" : "+query", description());
+ if (lazy) {
+ query.setLazyLoadBatchSize(loadBuffer.batchSize());
+ if (alreadyLoaded) {
+ query.setBeanCacheMode(CacheMode.OFF);
+ }
+ } else {
+ query.setBeanCacheMode(CacheMode.OFF);
}
loadBuffer.configureQuery(query, lazyLoadProperty);
+ if (loadCache) {
+ query.setBeanCacheMode(CacheMode.PUT);
+ }
if (idList.size() == 1) {
query.where().idEq(idList.get(0));
} else {
@@ -122,13 +105,12 @@ public final class LoadBeanRequest extends LoadRequest {
*/
public void postLoad(List> list) {
Set loadedIds = new HashSet<>();
- BeanDescriptor> desc = loadBuffer.getBeanDescriptor();
+ BeanDescriptor> desc = loadBuffer.descriptor();
// collect Ids and maybe load bean cache
for (Object bean : list) {
- EntityBean loadedBean = (EntityBean) bean;
- loadedIds.add(desc.getId(loadedBean));
+ loadedIds.add(desc.id(bean));
}
- if (isLoadCache()) {
+ if (loadCache) {
desc.cacheBeanPutAll(list);
}
if (lazyLoadProperty != null) {
diff --git a/ebean-core/src/main/java/io/ebeaninternal/api/LoadManyRequest.java b/ebean-core/src/main/java/io/ebeaninternal/api/LoadManyRequest.java
index cd49558d6..a304be78d 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/api/LoadManyRequest.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/api/LoadManyRequest.java
@@ -1,5 +1,6 @@
package io.ebeaninternal.api;
+import io.ebean.CacheMode;
import io.ebean.bean.BeanCollection;
import io.ebean.bean.EntityBean;
import io.ebeaninternal.server.core.BindPadding;
@@ -47,96 +48,58 @@ public final class LoadManyRequest extends LoadRequest {
}
@Override
- public Class> getBeanType() {
- return loadContext.getBeanDescriptor().getBeanType();
+ public Class> beanType() {
+ return loadContext.getBeanDescriptor().type();
}
- public String getDescription() {
- return "path:" + loadContext.getFullPath() + " size:" + batch.size();
- }
-
- /**
- * Return the batch of collections to actually load.
- */
- public List> getBatch() {
- return batch;
- }
-
- /**
- * Return true if lazy loading should only load the id values.
- *
- * This for use when lazy loading is invoked on methods such as clear() and removeAll() where it
- * generally makes sense to only fetch the Id values as the other property information is not
- * used.
- */
- private boolean isOnlyIds() {
- return onlyIds;
- }
-
- /**
- * Return true if we should load the Collection ids into the cache.
- */
- private boolean isLoadCache() {
- return loadCache;
- }
-
- /**
- * Return the batch size used for this load context.
- */
- public int getBatchSize() {
- return loadContext.getBatchSize();
+ public String description() {
+ return loadContext.getFullPath();
}
private List parentIdList(SpiEbeanServer server) {
List idList = new ArrayList<>();
- BeanPropertyAssocMany> many = getMany();
+ BeanPropertyAssocMany> many = many();
for (BeanCollection> bc : batch) {
- idList.add(many.getParentId(bc.getOwnerBean()));
+ idList.add(many.parentId(bc.getOwnerBean()));
bc.setLoader(server); // don't use the load buffer again
}
- if (many.getTargetDescriptor().isPadInExpression()) {
+ if (many.targetDescriptor().isPadInExpression()) {
BindPadding.padIds(idList);
}
return idList;
}
- private BeanPropertyAssocMany> getMany() {
+ private BeanPropertyAssocMany> many() {
return loadContext.getBeanProperty();
}
public SpiQuery> createQuery(SpiEbeanServer server) {
- BeanPropertyAssocMany> many = getMany();
+ BeanPropertyAssocMany> many = many();
SpiQuery> query = many.newQuery(server);
- String orderBy = many.getLazyFetchOrderBy();
+ String orderBy = many.lazyFetchOrderBy();
if (orderBy != null) {
query.order(orderBy);
}
-
- String extraWhere = many.getExtraWhere();
+ String extraWhere = many.extraWhere();
if (extraWhere != null) {
// replace special ${ta} placeholder with the base table alias
// which is always t0 and add the extra where clause
query.where().raw(extraWhere.replace("${ta}", "t0").replace("${mta}", "int_"));
}
-
query.setLazyLoadForParents(many);
many.addWhereParentIdIn(query, parentIdList(server), loadContext.isUseDocStore());
query.setPersistenceContext(loadContext.getPersistenceContext());
-
- String mode = isLazy() ? "+lazy" : "+query";
- query.setLoadDescription(mode, getDescription());
-
- if (isLazy()) {
- // cascade the batch size (if set) for further lazy loading
- query.setLazyLoadBatchSize(getBatchSize());
+ query.setLoadDescription(lazy ? "+lazy" : "+query", description());
+ if (lazy) {
+ query.setLazyLoadBatchSize(loadContext.getBatchSize());
+ } else {
+ query.setBeanCacheMode(CacheMode.OFF);
}
-
- // potentially changes the joins and selected properties
+ // potentially changes the joins, selected properties, cache mode
loadContext.configureQuery(query);
-
- if (isOnlyIds()) {
- // override to just select the Id values
- query.select(many.getTargetIdProperty());
+ if (onlyIds) {
+ // lazy loading invoked via clear() and removeAll()
+ query.select(many.targetIdProperty());
}
return query;
}
@@ -146,7 +109,7 @@ public final class LoadManyRequest extends LoadRequest {
*/
public void postLoad() {
BeanDescriptor> desc = loadContext.getBeanDescriptor();
- BeanPropertyAssocMany> many = getMany();
+ BeanPropertyAssocMany> many = many();
// check for BeanCollection's that where never processed
// in the +query or +lazy load due to no rows (predicates)
for (BeanCollection> bc : batch) {
@@ -156,9 +119,8 @@ public final class LoadManyRequest extends LoadRequest {
Object parentId = desc.getId(ownerBean);
logger.debug("BeanCollection after lazy load was empty. type:" + ownerBean.getClass().getName() + " id:" + parentId + " owner:" + ownerBean);
}
- } else if (isLoadCache() && many.isUseCache()) {
- Object parentId = desc.getId(bc.getOwnerBean());
- desc.cacheManyPropPut(many, bc, parentId);
+ } else if (loadCache && many.isUseCache()) {
+ desc.cacheManyPropPut(many, bc, desc.getId(bc.getOwnerBean()));
}
}
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/api/LoadRequest.java b/ebean-core/src/main/java/io/ebeaninternal/api/LoadRequest.java
index 516bcddb2..b8259d5b1 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/api/LoadRequest.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/api/LoadRequest.java
@@ -9,22 +9,19 @@ import io.ebeaninternal.server.core.OrmQueryRequest;
public abstract class LoadRequest {
protected final OrmQueryRequest> parentRequest;
-
protected final Transaction transaction;
-
protected final boolean lazy;
- public LoadRequest(OrmQueryRequest> parentRequest, boolean lazy) {
-
+ LoadRequest(OrmQueryRequest> parentRequest, boolean lazy) {
this.parentRequest = parentRequest;
- this.transaction = parentRequest == null ? null : parentRequest.getTransaction();
+ this.transaction = parentRequest == null ? null : parentRequest.transaction();
this.lazy = lazy;
}
/**
* Return the associated bean type for this load request.
*/
- public abstract Class> getBeanType();
+ public abstract Class> beanType();
/**
* Return true if this is a lazy load and false if it is a secondary query.
@@ -39,7 +36,7 @@ public abstract class LoadRequest {
* Lazy loading queries run in their own transaction.
*
*/
- public Transaction getTransaction() {
+ public Transaction transaction() {
return transaction;
}
@@ -48,6 +45,6 @@ public abstract class LoadRequest {
* So one of - findIterate(), findEach(), findEachWhile() or findVisit().
*/
public boolean isParentFindIterate() {
- return parentRequest != null && parentRequest.getQuery().getType() == SpiQuery.Type.ITERATE;
+ return parentRequest != null && parentRequest.query().getType() == SpiQuery.Type.ITERATE;
}
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/api/ManyWhereJoins.java b/ebean-core/src/main/java/io/ebeaninternal/api/ManyWhereJoins.java
index 91fc49d21..93e4111ef 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/api/ManyWhereJoins.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/api/ManyWhereJoins.java
@@ -49,15 +49,15 @@ public final class ManyWhereJoins implements Serializable {
*/
public void add(ElPropertyDeploy elProp) {
- String join = elProp.getElPrefix();
- BeanProperty p = elProp.getBeanProperty();
+ String join = elProp.elPrefix();
+ BeanProperty p = elProp.beanProperty();
if (p instanceof BeanPropertyAssocMany>) {
- join = addManyToJoin(join, p.getName());
+ join = addManyToJoin(join, p.name());
}
if (join != null) {
addJoin(join);
if (p != null) {
- String secondaryTableJoinPrefix = p.getSecondaryTableJoinPrefix();
+ String secondaryTableJoinPrefix = p.secondaryTableJoinPrefix();
if (secondaryTableJoinPrefix != null) {
addJoin(join + "." + secondaryTableJoinPrefix);
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/api/SpiBeanTypeManager.java b/ebean-core/src/main/java/io/ebeaninternal/api/SpiBeanTypeManager.java
index 0a6b79d78..57e19db81 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/api/SpiBeanTypeManager.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/api/SpiBeanTypeManager.java
@@ -8,6 +8,6 @@ public interface SpiBeanTypeManager {
/**
* Return the bean type for the given entity class.
*/
- SpiBeanType getBeanType(Class> entityType);
+ SpiBeanType beanType(Class> entityType);
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/api/SpiDtoQuery.java b/ebean-core/src/main/java/io/ebeaninternal/api/SpiDtoQuery.java
index 16cee411c..cc64fb097 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/api/SpiDtoQuery.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/api/SpiDtoQuery.java
@@ -36,11 +36,6 @@ public interface SpiDtoQuery extends DtoQuery, SpiSqlBinding {
*/
boolean isRelaxedMode();
- /**
- * Return the label for the query.
- */
- String getLabel();
-
/**
* Return the label with fallback to profile location label.
*/
diff --git a/ebean-core/src/main/java/io/ebeaninternal/api/SpiEbeanServer.java b/ebean-core/src/main/java/io/ebeaninternal/api/SpiEbeanServer.java
index fae60f49d..449a528f4 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/api/SpiEbeanServer.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/api/SpiEbeanServer.java
@@ -8,6 +8,7 @@ import io.ebean.config.dbplatform.DatabasePlatform;
import io.ebean.event.readaudit.ReadAuditLogger;
import io.ebean.event.readaudit.ReadAuditPrepare;
import io.ebean.meta.MetricVisitor;
+import io.ebean.plugin.SpiServer;
import io.ebeaninternal.api.SpiQuery.Type;
import io.ebeaninternal.server.core.SpiResultSet;
import io.ebeaninternal.server.core.timezone.DataTimeZone;
@@ -23,7 +24,7 @@ import java.util.stream.Stream;
/**
* Service Provider extension to EbeanServer.
*/
-public interface SpiEbeanServer extends ExtendedServer, EbeanServer, BeanCollectionLoader {
+public interface SpiEbeanServer extends SpiServer, ExtendedServer, EbeanServer, BeanCollectionLoader {
/**
* Return true if the L2 cache has been disabled.
@@ -50,16 +51,6 @@ public interface SpiEbeanServer extends ExtendedServer, EbeanServer, BeanCollect
*/
Object currentTenantId();
- /**
- * Return the server configuration.
- */
- DatabaseConfig getServerConfig();
-
- /**
- * Return the DatabasePlatform for this server.
- */
- DatabasePlatform getDatabasePlatform();
-
/**
* Create an object to represent the current CallStack.
*
@@ -72,7 +63,7 @@ public interface SpiEbeanServer extends ExtendedServer, EbeanServer, BeanCollect
/**
* Return the PersistenceContextScope to use defined at query or server level.
*/
- PersistenceContextScope getPersistenceContextScope(SpiQuery> query);
+ PersistenceContextScope persistenceContextScope(SpiQuery> query);
/**
* Clear the query execution statistics.
@@ -82,32 +73,32 @@ public interface SpiEbeanServer extends ExtendedServer, EbeanServer, BeanCollect
/**
* Return the transaction manager.
*/
- SpiTransactionManager getTransactionManager();
+ SpiTransactionManager transactionManager();
/**
* Return all the descriptors.
*/
- List> getBeanDescriptors();
+ List> descriptors();
/**
* Return the BeanDescriptor for a given type of bean.
*/
- BeanDescriptor getBeanDescriptor(Class type);
+ BeanDescriptor descriptor(Class type);
/**
* Return BeanDescriptor using it's unique id.
*/
- BeanDescriptor> getBeanDescriptorById(String className);
+ BeanDescriptor> descriptorById(String className);
/**
* Return BeanDescriptor using it's unique doc store queueId.
*/
- BeanDescriptor> getBeanDescriptorByQueueId(String queueId);
+ BeanDescriptor> descriptorByQueueId(String queueId);
/**
* Return BeanDescriptors mapped to this table.
*/
- List> getBeanDescriptors(String tableName);
+ List> descriptors(String tableName);
/**
* Process committed changes from another framework.
@@ -179,7 +170,7 @@ public interface SpiEbeanServer extends ExtendedServer, EbeanServer, BeanCollect
/**
* Return the default batch size for lazy loading.
*/
- int getLazyLoadBatchSize();
+ int lazyLoadBatchSize();
/**
* Return true if the type is known as an Entity or Xml type or a List Set or
@@ -190,18 +181,18 @@ public interface SpiEbeanServer extends ExtendedServer, EbeanServer, BeanCollect
/**
* Return the ReadAuditLogger to use for logging all read audit events.
*/
- ReadAuditLogger getReadAuditLogger();
+ ReadAuditLogger readAuditLogger();
/**
* Return the ReadAuditPrepare used to populate the read audit events with
* user context information (user id, user ip address etc).
*/
- ReadAuditPrepare getReadAuditPrepare();
+ ReadAuditPrepare readAuditPrepare();
/**
* Return the DataTimeZone to use when reading/writing timestamps via JDBC.
*/
- DataTimeZone getDataTimeZone();
+ DataTimeZone dataTimeZone();
/**
* Check for slow query event.
diff --git a/ebean-core/src/main/java/io/ebeaninternal/api/SpiExpressionList.java b/ebean-core/src/main/java/io/ebeaninternal/api/SpiExpressionList.java
index c4764b30f..5c4ce37ed 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/api/SpiExpressionList.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/api/SpiExpressionList.java
@@ -44,8 +44,4 @@ public interface SpiExpressionList extends ExpressionList, SpiExpression {
// do nothing by default
}
- /**
- * Apply property prefix when filterMany expressions included in main query.
- */
- void prefixProperty(String path);
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/api/SpiTransactionProxy.java b/ebean-core/src/main/java/io/ebeaninternal/api/SpiTransactionProxy.java
index a63c04cc6..03824903b 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/api/SpiTransactionProxy.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/api/SpiTransactionProxy.java
@@ -318,8 +318,8 @@ public abstract class SpiTransactionProxy implements SpiTransaction {
}
@Override
- public Connection getConnection() {
- return transaction.getConnection();
+ public Connection connection() {
+ return transaction.connection();
}
@Override
diff --git a/ebean-core/src/main/java/io/ebeaninternal/api/TransactionEventTable.java b/ebean-core/src/main/java/io/ebeaninternal/api/TransactionEventTable.java
index de55cd163..d9bf0f3a3 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/api/TransactionEventTable.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/api/TransactionEventTable.java
@@ -39,7 +39,7 @@ public final class TransactionEventTable implements Serializable, BinaryWritable
}
public void add(TableIUD newTableIUD) {
- TableIUD existingTableIUD = map.put(newTableIUD.getTableName(), newTableIUD);
+ TableIUD existingTableIUD = map.put(newTableIUD.tableName(), newTableIUD);
if (existingTableIUD != null) {
newTableIUD.add(existingTableIUD);
}
@@ -104,7 +104,7 @@ public final class TransactionEventTable implements Serializable, BinaryWritable
}
@Override
- public String getTableName() {
+ public String tableName() {
return table;
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/cache/CacheChangeSet.java b/ebean-core/src/main/java/io/ebeaninternal/server/cache/CacheChangeSet.java
index a1393db06..298b856df 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/cache/CacheChangeSet.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/cache/CacheChangeSet.java
@@ -63,7 +63,7 @@ public final class CacheChangeSet {
* Add an entry to clear a query cache.
*/
public void addInvalidate(BeanDescriptor> descriptor) {
- touchedTables.add(descriptor.getBaseTable());
+ touchedTables.add(descriptor.baseTable());
}
/**
@@ -78,7 +78,7 @@ public final class CacheChangeSet {
*/
public void addClearQuery(BeanDescriptor> descriptor) {
queryCaches.add(descriptor);
- touchedTables.add(descriptor.getBaseTable());
+ touchedTables.add(descriptor.baseTable());
}
/**
@@ -125,7 +125,7 @@ public final class CacheChangeSet {
entry.addId(id);
} else {
beanRemoveMap.put(desc, new CacheChangeBeanRemove(id, desc));
- touchedTables.add(desc.getBaseTable());
+ touchedTables.add(desc.baseTable());
}
}
@@ -138,7 +138,7 @@ public final class CacheChangeSet {
entry.addIds(ids);
} else {
beanRemoveMap.put(desc, new CacheChangeBeanRemove(desc, ids));
- touchedTables.add(desc.getBaseTable());
+ touchedTables.add(desc.baseTable());
}
}
@@ -146,7 +146,7 @@ public final class CacheChangeSet {
* Update a bean entry.
*/
public void addBeanUpdate(BeanDescriptor desc, String key, Map changes, boolean updateNaturalKey, long version) {
- touchedTables.add(desc.getBaseTable());
+ touchedTables.add(desc.baseTable());
entries.add(new CacheChangeBeanUpdate(desc, key, changes, updateNaturalKey, version));
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/cache/CachedBeanDataFromBean.java b/ebean-core/src/main/java/io/ebeaninternal/server/cache/CachedBeanDataFromBean.java
index 2fd3fd46b..2405e03bc 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/cache/CachedBeanDataFromBean.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/cache/CachedBeanDataFromBean.java
@@ -15,33 +15,33 @@ public final class CachedBeanDataFromBean {
EntityBeanIntercept ebi = bean._ebean_getIntercept();
Map data = new LinkedHashMap<>();
- BeanProperty idProperty = desc.getIdProperty();
+ BeanProperty idProperty = desc.idProperty();
if (idProperty != null) {
- int propertyIndex = idProperty.getPropertyIndex();
+ int propertyIndex = idProperty.propertyIndex();
if (ebi.isLoadedProperty(propertyIndex)) {
- data.put(idProperty.getName(), idProperty.getCacheDataValue(bean));
+ data.put(idProperty.name(), idProperty.getCacheDataValue(bean));
}
}
// extract all the non-many properties
final boolean dirty = ebi.isDirty();
for (BeanProperty prop : desc.propertiesNonMany()) {
- if (dirty && ebi.isDirtyProperty(prop.getPropertyIndex())) {
- data.put(prop.getName(), prop.getCacheDataValueOrig(ebi));
- } else if (ebi.isLoadedProperty(prop.getPropertyIndex())) {
- data.put(prop.getName(), prop.getCacheDataValue(bean));
+ if (dirty && ebi.isDirtyProperty(prop.propertyIndex())) {
+ data.put(prop.name(), prop.getCacheDataValueOrig(ebi));
+ } else if (ebi.isLoadedProperty(prop.propertyIndex())) {
+ data.put(prop.name(), prop.getCacheDataValue(bean));
}
}
for (BeanPropertyAssocMany> prop : desc.propertiesMany()) {
if (prop.isElementCollection()) {
- data.put(prop.getName(), prop.getCacheDataValue(bean));
+ data.put(prop.name(), prop.getCacheDataValue(bean));
}
}
long version = desc.getVersion(bean);
EntityBean sharableBean = createSharableBean(desc, bean, ebi);
- return new CachedBeanData(sharableBean, desc.getDiscValue(), data, version);
+ return new CachedBeanData(sharableBean, desc.discValue(), data, version);
}
private static EntityBean createSharableBean(BeanDescriptor> desc, EntityBean bean, EntityBeanIntercept beanEbi) {
@@ -54,7 +54,7 @@ public final class CachedBeanDataFromBean {
// create a readOnly sharable instance by copying the data
EntityBean sharableBean = desc.createEntityBean();
- BeanProperty idProp = desc.getIdProperty();
+ BeanProperty idProp = desc.idProperty();
if (idProp != null) {
Object v = idProp.getValue(bean);
idProp.setValue(sharableBean, v);
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/cache/CachedBeanDataToBean.java b/ebean-core/src/main/java/io/ebeaninternal/server/cache/CachedBeanDataToBean.java
index 08f3a80fd..ae5b922a9 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/cache/CachedBeanDataToBean.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/cache/CachedBeanDataToBean.java
@@ -13,9 +13,9 @@ public final class CachedBeanDataToBean {
EntityBeanIntercept ebi = bean._ebean_getIntercept();
// any future lazy loading skips L2 bean cache
ebi.setLoadedFromCache(true);
- BeanProperty idProperty = desc.getIdProperty();
- if (desc.getInheritInfo() != null) {
- desc = desc.getInheritInfo().readType(bean.getClass()).desc();
+ BeanProperty idProperty = desc.idProperty();
+ if (desc.inheritInfo() != null) {
+ desc = desc.inheritInfo().readType(bean.getClass()).desc();
}
if (idProperty != null) {
// load the id property
@@ -36,9 +36,9 @@ public final class CachedBeanDataToBean {
}
private static void loadProperty(EntityBean bean, CachedBeanData cacheBeanData, EntityBeanIntercept ebi, BeanProperty prop, PersistenceContext context) {
- if (cacheBeanData.isLoaded(prop.getName())) {
- if (!ebi.isLoadedProperty(prop.getPropertyIndex())) {
- Object value = cacheBeanData.getData(prop.getName());
+ if (cacheBeanData.isLoaded(prop.name())) {
+ if (!ebi.isLoadedProperty(prop.propertyIndex())) {
+ Object value = cacheBeanData.getData(prop.name());
prop.setCacheDataValue(bean, value, context);
}
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/cache/DefaultCacheAdapter.java b/ebean-core/src/main/java/io/ebeaninternal/server/cache/DefaultCacheAdapter.java
index 413af049d..e9b3752d6 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/cache/DefaultCacheAdapter.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/cache/DefaultCacheAdapter.java
@@ -27,7 +27,7 @@ public final class DefaultCacheAdapter implements ServerCacheManager {
}
@Override
- public boolean isLocalL2Caching() {
+ public boolean localL2Caching() {
return cacheManager.isLocalL2Caching();
}
@@ -37,37 +37,37 @@ public final class DefaultCacheAdapter implements ServerCacheManager {
}
@Override
- public void setEnabledRegions(String regions) {
+ public void enabledRegions(String regions) {
cacheManager.setEnabledRegions(regions);
}
@Override
- public ServerCacheRegion getRegion(String region) {
+ public ServerCacheRegion region(String region) {
return cacheManager.getRegion(region);
}
@Override
- public void setAllRegionsEnabled(boolean enabled) {
+ public void allRegionsEnabled(boolean enabled) {
cacheManager.setAllRegionsEnabled(enabled);
}
@Override
- public ServerCache getNaturalKeyCache(Class> beanType) {
+ public ServerCache naturalKeyCache(Class> beanType) {
return cacheManager.getNaturalKeyCache(beanType);
}
@Override
- public ServerCache getBeanCache(Class> beanType) {
+ public ServerCache beanCache(Class> beanType) {
return cacheManager.getBeanCache(beanType);
}
@Override
- public ServerCache getCollectionIdsCache(Class> beanType, String propertyName) {
+ public ServerCache collectionIdsCache(Class> beanType, String propertyName) {
return cacheManager.getCollectionIdsCache(beanType, propertyName);
}
@Override
- public ServerCache getQueryCache(Class> beanType) {
+ public ServerCache queryCache(Class> beanType) {
return cacheManager.getQueryCache(beanType);
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/cache/DefaultServerCacheManager.java b/ebean-core/src/main/java/io/ebeaninternal/server/cache/DefaultServerCacheManager.java
index 562a98371..d3a652437 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/cache/DefaultServerCacheManager.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/cache/DefaultServerCacheManager.java
@@ -65,17 +65,17 @@ public final class DefaultServerCacheManager implements SpiCacheManager {
List enabled = new ArrayList<>();
for (SpiCacheRegion region : regionMap.values()) {
- if (enabledRegionNames.contains(region.getName())) {
- enabled.add(region.getName());
+ if (enabledRegionNames.contains(region.name())) {
+ enabled.add(region.name());
if (!region.isEnabled()) {
region.setEnabled(true);
- log.debug("Cache region[{}] enabled", region.getName());
+ log.debug("Cache region[{}] enabled", region.name());
}
} else {
- disabled.add(region.getName());
+ disabled.add(region.name());
if (region.isEnabled()) {
region.setEnabled(false);
- log.debug("Cache region[{}] disabled", region.getName());
+ log.debug("Cache region[{}] disabled", region.name());
}
}
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/changelog/DefaultChangeLogListener.java b/ebean-core/src/main/java/io/ebeaninternal/server/changelog/DefaultChangeLogListener.java
index 6e12aa31d..5cda1ed36 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/changelog/DefaultChangeLogListener.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/changelog/DefaultChangeLogListener.java
@@ -46,7 +46,7 @@ public final class DefaultChangeLogListener implements ChangeLogListener, Plugin
@Override
public void configure(SpiServer server) {
jsonBuilder = new ChangeJsonBuilder();
- Properties properties = server.getServerConfig().getProperties();
+ Properties properties = server.config().getProperties();
if (properties != null) {
String bufferSize = properties.getProperty("ebean.changeLog.bufferSize");
if (bufferSize != null) {
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/cluster/ClusterManager.java b/ebean-core/src/main/java/io/ebeaninternal/server/cluster/ClusterManager.java
index d2bdaeda7..a85444486 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/cluster/ClusterManager.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/cluster/ClusterManager.java
@@ -56,7 +56,7 @@ public class ClusterManager implements ServerLookup {
public void registerServer(EbeanServer server) {
lock.lock();
try {
- serverMap.put(server.getName(), server);
+ serverMap.put(server.name(), server);
if (!started) {
startup();
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/core/AbstractSqlQueryRequest.java b/ebean-core/src/main/java/io/ebeaninternal/server/core/AbstractSqlQueryRequest.java
index a88f1bbe9..f11cf9f8e 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/core/AbstractSqlQueryRequest.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/core/AbstractSqlQueryRequest.java
@@ -121,7 +121,7 @@ public abstract class AbstractSqlQueryRequest implements CancelableQuery {
int firstRow = query.getFirstRow();
int maxRows = query.getMaxRows();
if (firstRow > 0 || maxRows > 0) {
- return server.getDatabasePlatform().getBasicSqlLimiter().limit(sql, firstRow, maxRows);
+ return server.databasePlatform().getBasicSqlLimiter().limit(sql, firstRow, maxRows);
}
return sql;
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/core/BeanRequest.java b/ebean-core/src/main/java/io/ebeaninternal/server/core/BeanRequest.java
index 74327b5f2..0bec5a5a5 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/core/BeanRequest.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/core/BeanRequest.java
@@ -14,21 +14,13 @@ public abstract class BeanRequest {
static final Logger log = LoggerFactory.getLogger(BeanRequest.class);
- /**
- * The server processing the request.
- */
- protected final SpiEbeanServer ebeanServer;
-
- /**
- * The transaction this is part of.
- */
+ protected final SpiEbeanServer server;
protected SpiTransaction transaction;
-
protected boolean createdTransaction;
- public BeanRequest(SpiEbeanServer ebeanServer, SpiTransaction t) {
- this.ebeanServer = ebeanServer;
- this.transaction = t;
+ public BeanRequest(SpiEbeanServer server, SpiTransaction transaction) {
+ this.server = server;
+ this.transaction = transaction;
}
/**
@@ -36,7 +28,6 @@ public abstract class BeanRequest {
*
* A transaction may have been passed in or active in the thread local. If
* not then create one implicitly to handle the request.
- *
*/
- public CQueryPlanKey getQueryPlanKey() {
+ public CQueryPlanKey queryPlanKey() {
return queryPlanKey;
}
@@ -552,7 +533,7 @@ public final class OrmQueryRequest extends BeanRequest implements SpiOrmQuery
* Put the QueryPlan into the cache.
*/
public void putQueryPlan(CQueryPlan queryPlan) {
- beanDescriptor.putQueryPlan(queryPlanKey, queryPlan);
+ beanDescriptor.queryPlan(queryPlanKey, queryPlan);
}
@Override
@@ -608,7 +589,7 @@ public final class OrmQueryRequest extends BeanRequest implements SpiOrmQuery
}
@Override
- public List getBeanCacheHits() {
+ public List beanCacheHits() {
OrderBy orderBy = query.getOrderBy();
if (orderBy != null) {
beanDescriptor.sort(cacheBeans, orderBy.toStringFormat());
@@ -617,7 +598,7 @@ public final class OrmQueryRequest extends BeanRequest implements SpiOrmQuery
}
@Override
- public Map getBeanCacheHitsAsMap() {
+ public Map beanCacheHitsAsMap() {
OrderBy orderBy = query.getOrderBy();
if (orderBy != null) {
beanDescriptor.sort(cacheBeans, orderBy.toStringFormat());
@@ -636,7 +617,7 @@ public final class OrmQueryRequest extends BeanRequest implements SpiOrmQuery
}
private ElPropertyValue mapProperty() {
- ElPropertyValue property = beanDescriptor.getElGetValue(query.getMapKey());
+ ElPropertyValue property = beanDescriptor.elGetValue(query.getMapKey());
if (property == null) {
throw new IllegalStateException("Unknown map key property "+query.getMapKey());
}
@@ -665,7 +646,6 @@ public final class OrmQueryRequest extends BeanRequest implements SpiOrmQuery
if (!beanDescriptor.isNaturalKeyCaching()) {
return false;
}
-
NaturalKeyQueryData data = query.naturalKey();
if (data != null) {
NaturalKeySet naturalKeySet = data.buildKeys();
@@ -688,30 +668,27 @@ public final class OrmQueryRequest extends BeanRequest implements SpiOrmQuery
public Object getFromQueryCache() {
if (query.getUseQueryCache() == CacheMode.OFF
|| (transaction != null && transaction.isSkipCache())
- || ebeanServer.isDisableL2Cache()) {
+ || server.isDisableL2Cache()) {
return null;
} else {
cacheKey = query.queryHash();
}
-
if (!query.getUseQueryCache().isGet()) {
return null;
}
Object cached = beanDescriptor.queryCacheGet(cacheKey);
-
if (cached != null && isAuditReads() && readAuditQueryType()) {
if (cached instanceof BeanCollection) {
// raw sql can't use L2 cache so normal queries only in here
Collection actualDetails = ((BeanCollection)cached).getActualDetails();
List ids = new ArrayList<>(actualDetails.size());
for (T bean : actualDetails) {
- ids.add(beanDescriptor.getIdForJson(bean));
+ ids.add(beanDescriptor.idForJson(bean));
}
beanDescriptor.readAuditMany(queryPlanKey.getPartialKey(), "l2-query-cache", ids);
}
}
-
if (Boolean.FALSE.equals(query.isReadOnly())) {
// return shallow copies if readonly is explicitly set to false
if (cached instanceof BeanCollection) {
@@ -750,7 +727,7 @@ public final class OrmQueryRequest extends BeanRequest implements SpiOrmQuery
}
/**
- * Set an Query object that owns the PreparedStatement that can be cancelled.
+ * Set a Query object that owns the PreparedStatement that can be cancelled.
*/
public void setCancelableQuery(CancelableQuery cancelableQuery) {
query.setCancelableQuery(cancelableQuery);
@@ -766,16 +743,15 @@ public final class OrmQueryRequest extends BeanRequest implements SpiOrmQuery
/**
* Return the batch size for lazy loading on this bean query request.
*/
- public int getLazyLoadBatchSize() {
+ public int lazyLoadBatchSize() {
int batchSize = query.getLazyLoadBatchSize();
- return (batchSize > 0) ? batchSize : ebeanServer.getLazyLoadBatchSize();
+ return (batchSize > 0) ? batchSize : server.lazyLoadBatchSize();
}
/**
* Return true if read auditing is on for this query request.
*
* This means that read audit is on for this bean type and that query has not explicitly disabled it.
- *
*/
public boolean isAuditReads() {
return beanDescriptor.isReadAuditing() && !query.isDisableReadAudit();
@@ -784,8 +760,8 @@ public final class OrmQueryRequest extends BeanRequest implements SpiOrmQuery
/**
* Return the base table alias for this query.
*/
- public String getBaseTableAlias() {
- return query.getAlias(beanDescriptor.getBaseTableAlias());
+ public String baseTableAlias() {
+ return query.getAlias(beanDescriptor.baseTableAlias());
}
/**
@@ -798,7 +774,7 @@ public final class OrmQueryRequest extends BeanRequest implements SpiOrmQuery
/**
* Return the tenantId associated with this request.
*/
- public Object getTenantId() {
+ public Object tenantId() {
return (transaction == null) ? null : transaction.getTenantId();
}
@@ -806,7 +782,7 @@ public final class OrmQueryRequest extends BeanRequest implements SpiOrmQuery
* Check for slow query event.
*/
public void slowQueryCheck(long executionTimeMicros, int rowCount) {
- ebeanServer.slowQueryCheck(executionTimeMicros, rowCount, query);
+ server.slowQueryCheck(executionTimeMicros, rowCount, query);
}
public void setInlineCountDistinct() {
@@ -830,6 +806,6 @@ public final class OrmQueryRequest extends BeanRequest implements SpiOrmQuery
* Return true if no MaxRows or use LIMIT in SQL update.
*/
public boolean isInlineSqlUpdateLimit() {
- return query.getMaxRows() < 1 || ebeanServer.getDatabasePlatform().isInlineSqlUpdateLimit();
+ return query.getMaxRows() < 1 || server.databasePlatform().isInlineSqlUpdateLimit();
}
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistDeferredRelationship.java b/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistDeferredRelationship.java
index 41bbb20ef..279bf6329 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistDeferredRelationship.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistDeferredRelationship.java
@@ -35,13 +35,13 @@ public final class PersistDeferredRelationship {
*/
public void execute(SpiTransaction transaction) {
- String sql = beanDescriptor.getUpdateImportedIdSql(importedId);
+ String sql = beanDescriptor.updateImportedIdSql(importedId);
SqlUpdate sqlUpdate = ebeanServer.sqlUpdate(sql);
// bind the set clause for the importedId
int pos = importedId.bind(1, sqlUpdate, assocBean);
// bind the where clause for the bean
- Object[] idValues = beanDescriptor.getIdBinder().getIdValues(bean);
+ Object[] idValues = beanDescriptor.idBinder().getIdValues(bean);
for (int j = 0; j < idValues.length; j++) {
sqlUpdate.setParameter(pos + j, idValues[j]);
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequest.java b/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequest.java
index af6ed1aeb..1eab09911 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequest.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequest.java
@@ -31,17 +31,10 @@ public abstract class PersistRequest extends BeanRequest implements BatchPostExe
}
}
- boolean persistCascade;
-
- /**
- * One of INSERT, UPDATE, DELETE, UPDATESQL or CALLABLESQL.
- */
protected Type type;
-
+ boolean persistCascade;
final PersistExecute persistExecute;
-
protected String label;
-
protected long startNanos;
PersistRequest(SpiEbeanServer server, SpiTransaction t, PersistExecute persistExecute) {
@@ -95,12 +88,12 @@ public abstract class PersistRequest extends BeanRequest implements BatchPostExe
}
@Override
- public boolean isLogSql() {
+ public boolean logSql() {
return transaction.isLogSql();
}
@Override
- public boolean isLogSummary() {
+ public boolean logSummary() {
return transaction.isLogSummary();
}
@@ -149,10 +142,9 @@ public abstract class PersistRequest extends BeanRequest implements BatchPostExe
}
/**
- * Return the type of this request. One of INSERT, UPDATE, DELETE, UPDATESQL
- * or CALLABLESQL.
+ * Return the type of this request. One of INSERT, UPDATE, DELETE, UPDATESQL or CALLABLESQL.
*/
- public Type getType() {
+ public Type type() {
return type;
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestBean.java b/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestBean.java
index 07aac16bb..fd4f8e555 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestBean.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestBean.java
@@ -50,142 +50,94 @@ import java.util.Set;
public final class PersistRequestBean extends PersistRequest implements BeanPersistRequest, DocStoreUpdate, PreGetterCallback, SpiProfileTransactionEvent {
private final BeanManager beanManager;
-
private final BeanDescriptor beanDescriptor;
-
private final BeanPersistListener beanPersistListener;
-
- /**
- * For per post insert update delete control.
- */
private final BeanPersistController controller;
-
- /**
- * The bean being persisted.
- */
private final T bean;
-
private final EntityBean entityBean;
-
- /**
- * The associated intercept.
- */
private final EntityBeanIntercept intercept;
-
/**
* The parent bean for unidirectional save.
*/
private final Object parentBean;
-
private final boolean dirty;
-
private final boolean publish;
-
private int flags;
-
private boolean saveRecurse;
-
private DocStoreMode docStoreMode;
-
private final ConcurrencyMode concurrencyMode;
-
/**
* The unique id used for logging summary.
*/
private Object idValue;
-
/**
* Hash value used to handle cascade delete both ways in a relationship.
*/
private Integer beanHash;
-
- /**
- * Flag set if this is a stateless update.
- */
private boolean statelessUpdate;
-
private boolean notifyCache;
-
/**
* Flag used to detect when only many properties where updated via a cascade. Used to ensure
* appropriate caches are updated in that case.
*/
private boolean updatedManysOnly;
-
/**
* Element collection change as part of bean cache.
*/
private Map collectionChanges;
-
/**
* Set true when the request includes cascade save to a many.
*/
private boolean updatedMany;
-
/**
* Many properties that were cascade saved (and hence might need caches updated later).
*/
private List> updatedManys;
-
/**
* Need to get and store the updated properties because the persist listener is notified
* later on a different thread and the bean has been reset at that point.
*/
private Set updatedProperties;
-
/**
* Flags indicating the dirty properties on the bean.
*/
private boolean[] dirtyProperties;
-
/**
* Imported OneToOne orphan that needs to be deleted.
*/
private EntityBean orphanBean;
-
/**
* Flag set when request is added to JDBC batch.
*/
private boolean batched;
-
/**
* Flag set when batchOnCascade to avoid using batch on the top bean.
*/
private boolean skipBatchForTopLevel;
-
/**
* Flag set when batch mode is turned on for a persist cascade.
*/
private boolean batchOnCascadeSet;
-
/**
* Set for updates to determine if all loaded properties are included in the update.
*/
private boolean requestUpdateAllLoadedProps;
-
private long version;
-
private long now;
-
private long profileOffset;
-
/**
* Flag set when request is added to JDBC batch registered as a "getter callback" to automatically flush batch.
*/
private boolean getterCallback;
-
private boolean pendingPostUpdateNotify;
-
/**
* Set to true when post execute has occurred (so includes batch flush).
*/
private boolean postExecute;
-
/**
* Set to true after many properties have been persisted (so includes element collections).
*/
private boolean complete;
-
/**
* Many to many intersection table changes that are held for later batch processing.
*/
@@ -198,10 +150,10 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
this.intercept = entityBean._ebean_getIntercept();
this.beanManager = mgr;
this.beanDescriptor = mgr.getBeanDescriptor();
- this.beanPersistListener = beanDescriptor.getPersistListener();
+ this.beanPersistListener = beanDescriptor.persistListener();
this.bean = bean;
this.parentBean = parentBean;
- this.controller = beanDescriptor.getPersistController();
+ this.controller = beanDescriptor.persistController();
this.type = type;
this.docStoreMode = calcDocStoreMode(transaction, type);
this.flags = flags;
@@ -217,7 +169,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
// Mark Mutable scalar properties (like Hstore) as dirty where necessary
beanDescriptor.checkMutableProperties(intercept);
}
- this.concurrencyMode = beanDescriptor.getConcurrencyMode(intercept);
+ this.concurrencyMode = beanDescriptor.concurrencyMode(intercept);
this.publish = Flags.isPublish(flags);
if (isMarkDraftDirty(publish)) {
beanDescriptor.setDraftDirty(entityBean, true);
@@ -247,7 +199,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
*/
@Override
public void profile(long offset, int flushCount) {
- profileBase(type.profileEventId, offset, beanDescriptor.getName(), flushCount);
+ profileBase(type.profileEventId, offset, beanDescriptor.name(), flushCount);
}
/**
@@ -258,7 +210,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
*/
private DocStoreMode calcDocStoreMode(SpiTransaction txn, Type type) {
DocStoreMode txnMode = (txn == null) ? null : txn.getDocStoreMode();
- return beanDescriptor.getDocStoreMode(type, txnMode);
+ return beanDescriptor.docStoreMode(type, txnMode);
}
/**
@@ -320,21 +272,21 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
private void onUpdateGeneratedProperties() {
for (BeanProperty prop : beanDescriptor.propertiesGenUpdate()) {
- GeneratedProperty generatedProperty = prop.getGeneratedProperty();
+ GeneratedProperty generatedProperty = prop.generatedProperty();
if (prop.isVersion()) {
if (isLoadedProperty(prop)) {
// @Version property must be loaded to be involved
Object value = generatedProperty.getUpdateValue(prop, entityBean, now());
Object oldVal = prop.getValue(entityBean);
setVersionValue(value);
- intercept.setOldValue(prop.getPropertyIndex(), oldVal);
+ intercept.setOldValue(prop.propertyIndex(), oldVal);
}
} else {
// @WhenModified set without invoking interception
Object oldVal = prop.getValue(entityBean);
Object value = generatedProperty.getUpdateValue(prop, entityBean, now());
prop.setValueChanged(entityBean, value);
- intercept.setOldValue(prop.getPropertyIndex(), oldVal);
+ intercept.setOldValue(prop.propertyIndex(), oldVal);
}
}
}
@@ -348,7 +300,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
private void onInsertGeneratedProperties() {
for (BeanProperty prop : beanDescriptor.propertiesGenInsert()) {
- Object value = prop.getGeneratedProperty().getInsertValue(prop, entityBean, now());
+ Object value = prop.generatedProperty().getInsertValue(prop, entityBean, now());
prop.setValueChanged(entityBean, value);
}
}
@@ -431,12 +383,12 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
}
@Override
- public Set getLoadedProperties() {
+ public Set loadedProperties() {
return intercept.getLoadedPropertyNames();
}
@Override
- public Set getUpdatedProperties() {
+ public Set updatedProperties() {
return intercept.getDirtyPropertyNames();
}
@@ -444,7 +396,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
* Return the dirty properties on this request.
*/
@Override
- public boolean[] getDirtyProperties() {
+ public boolean[] dirtyProperties() {
return dirtyProperties;
}
@@ -469,7 +421,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
}
@Override
- public Map getUpdatedValues() {
+ public Map updatedValues() {
return intercept.getDirtyValues();
}
@@ -550,10 +502,10 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
case INSERT:
case UPDATE:
case DELETE_SOFT:
- docStoreUpdates.queueIndex(beanDescriptor.getDocStoreQueueId(), idValue);
+ docStoreUpdates.queueIndex(beanDescriptor.docStoreQueueId(), idValue);
break;
case DELETE:
- docStoreUpdates.queueDelete(beanDescriptor.getDocStoreQueueId(), idValue);
+ docStoreUpdates.queueDelete(beanDescriptor.docStoreQueueId(), idValue);
break;
default:
throw new IllegalStateException("Invalid type " + type);
@@ -589,8 +541,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
}
/**
- * Return true if this bean has been already been persisted (inserted or updated) in this
- * transaction.
+ * Return true if this bean has been already been persisted (inserted or updated) in this transaction.
*/
public boolean isRegisteredBean() {
return transaction.isRegisteredBean(bean);
@@ -607,7 +558,6 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
* The hash used to register the bean with the transaction.
*
* Takes into account the class type and id value.
- *
*/
private Integer getBeanHash() {
if (beanHash == null) {
@@ -638,7 +588,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
/**
* Return the BeanDescriptor for the associated bean.
*/
- public BeanDescriptor getBeanDescriptor() {
+ public BeanDescriptor descriptor() {
return beanDescriptor;
}
@@ -663,7 +613,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
/**
* Return the concurrency mode used for this persist.
*/
- public ConcurrencyMode getConcurrencyMode() {
+ public ConcurrencyMode concurrencyMode() {
return concurrencyMode;
}
@@ -674,26 +624,26 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
* Used to determine common persist requests for queueing and statement batching.
*
*/
- public String getFullName() {
- return beanDescriptor.getFullName();
+ public String fullName() {
+ return beanDescriptor.fullName();
}
/**
* Return the bean associated with this request.
*/
@Override
- public T getBean() {
+ public T bean() {
return bean;
}
- public EntityBean getEntityBean() {
+ public EntityBean entityBean() {
return entityBean;
}
/**
* Return the Id value for the bean.
*/
- public Object getBeanId() {
+ public Object beanId() {
return beanDescriptor.getId(entityBean);
}
@@ -701,7 +651,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
* Create and return a new reference bean matching this beans Id value.
*/
public T createReference() {
- return beanDescriptor.createRef(getBeanId(), null);
+ return beanDescriptor.createRef(beanId(), null);
}
/**
@@ -746,14 +696,14 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
/**
* Return the parent bean for cascading save with unidirectional relationship.
*/
- public Object getParentBean() {
+ public Object parentBean() {
return parentBean;
}
/**
* Return the intercept if there is one.
*/
- public EntityBeanIntercept getEntityBeanIntercept() {
+ public EntityBeanIntercept intercept() {
return intercept;
}
@@ -761,21 +711,21 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
* Return true if this property is loaded (full bean or included in partial bean).
*/
public boolean isLoadedProperty(BeanProperty prop) {
- return intercept.isLoadedProperty(prop.getPropertyIndex());
+ return intercept.isLoadedProperty(prop.propertyIndex());
}
/**
* Return true if the property is dirty.
*/
public boolean isDirtyProperty(BeanProperty prop) {
- return intercept.isDirtyProperty(prop.getPropertyIndex());
+ return intercept.isDirtyProperty(prop.propertyIndex());
}
/**
* Return the original / old value for the given property.
*/
public Object getOrigValue(BeanProperty prop) {
- return intercept.getOrigValue(prop.getPropertyIndex());
+ return intercept.getOrigValue(prop.propertyIndex());
}
@Override
@@ -790,7 +740,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
case UPDATE:
if (beanPersistListener != null) {
// store the updated properties for sending later
- updatedProperties = getUpdatedProperties();
+ updatedProperties = updatedProperties();
}
executeUpdate();
return -1;
@@ -809,7 +759,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
* Soft delete is executed as update so we want to set deleted=true property.
*/
private void prepareForSoftDelete() {
- beanDescriptor.setSoftDeleteValue(entityBean);
+ beanDescriptor.softDeleteValue(entityBean);
}
@Override
@@ -861,7 +811,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
* Check for optimistic concurrency exception.
*/
@Override
- public final void checkRowCount(int rowCount) {
+ public void checkRowCount(int rowCount) {
if (rowCount != 1 && rowCount != Statement.SUCCESS_NO_INFO) {
if (ConcurrencyMode.VERSION == concurrencyMode) {
onFailedUpdateUndoGeneratedProperties();
@@ -913,7 +863,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
}
private void changeLog() {
- BeanChange changeLogBean = beanDescriptor.getChangeLogBean(this);
+ BeanChange changeLogBean = beanDescriptor.changeLogBean(this);
if (changeLogBean != null) {
transaction.addBeanChange(changeLogBean);
}
@@ -945,8 +895,8 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
}
addPostCommitListeners();
notifyCacheOnPostExecute();
- if (isLogSummary()) {
- logSummary();
+ if (logSummary()) {
+ logSummaryMessage();
}
}
@@ -993,9 +943,9 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
}
}
- private void logSummary() {
+ private void logSummaryMessage() {
String draft = (beanDescriptor.isDraftable() && !publish) ? " draft[true]" : "";
- String name = beanDescriptor.getName();
+ String name = beanDescriptor.name();
switch (type) {
case INSERT:
transaction.logSummary("Inserted [" + name + "] [" + idValue + "]" + draft);
@@ -1029,9 +979,9 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
*/
public boolean isAddToUpdate(BeanProperty prop) {
if (requestUpdateAllLoadedProps) {
- return intercept.isLoadedProperty(prop.getPropertyIndex());
+ return intercept.isLoadedProperty(prop.propertyIndex());
} else {
- return intercept.isDirtyProperty(prop.getPropertyIndex());
+ return intercept.isDirtyProperty(prop.propertyIndex());
}
}
@@ -1039,7 +989,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
* Register the derived relationships to get executed later (on JDBC batch flush or commit).
*/
public void deferredRelationship(EntityBean assocBean, ImportedId importedId, EntityBean bean) {
- transaction.registerDeferred(new PersistDeferredRelationship(ebeanServer, beanDescriptor, assocBean, importedId, bean));
+ transaction.registerDeferred(new PersistDeferredRelationship(server, beanDescriptor, assocBean, importedId, bean));
}
private void postInsert() {
@@ -1082,7 +1032,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
/**
* Return the list of updated many properties for L2 cache update (can be null).
*/
- public List> getUpdatedManyForL2Cache() {
+ public List> updatedManyForL2Cache() {
return updatedManys;
}
@@ -1159,9 +1109,9 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
}
case QUEUE: {
if (type == Type.DELETE) {
- docStoreUpdates.queueDelete(beanDescriptor.getDocStoreQueueId(), idValue);
+ docStoreUpdates.queueDelete(beanDescriptor.docStoreQueueId(), idValue);
} else {
- docStoreUpdates.queueIndex(beanDescriptor.getDocStoreQueueId(), idValue);
+ docStoreUpdates.queueIndex(beanDescriptor.docStoreQueueId(), idValue);
}
}
break;
@@ -1183,7 +1133,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
requestUpdateAllLoadedProps = txnUpdateAll;
} else {
// if using batch use the server default setting
- requestUpdateAllLoadedProps = isBatchThisRequest() && ebeanServer.isUpdateAllPropertiesInBatch();
+ requestUpdateAllLoadedProps = isBatchThisRequest() && server.isUpdateAllPropertiesInBatch();
}
return requestUpdateAllLoadedProps;
}
@@ -1191,7 +1141,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
/**
* Return the flags set on this persist request.
*/
- public int getFlags() {
+ public int flags() {
return flags;
}
@@ -1205,16 +1155,16 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
/**
* Return the key for an update persist request.
*/
- public String getUpdatePlanHash() {
+ public String updatePlanHash() {
StringBuilder key;
if (determineUpdateAllLoadedProperties()) {
key = intercept.getLoadedPropertyKey();
} else {
key = intercept.getDirtyPropertyKey();
}
- BeanProperty versionProperty = beanDescriptor.getVersionProperty();
+ BeanProperty versionProperty = beanDescriptor.versionProperty();
if (versionProperty != null) {
- if (intercept.isLoadedProperty(versionProperty.getPropertyIndex())) {
+ if (intercept.isLoadedProperty(versionProperty.propertyIndex())) {
key.append('v');
}
}
@@ -1227,8 +1177,8 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
/**
* Return the table to update depending if the request is a 'publish' one or normal.
*/
- public String getUpdateTable() {
- return publish ? beanDescriptor.getBaseTable() : beanDescriptor.getDraftTable();
+ public String updateTable() {
+ return publish ? beanDescriptor.baseTable() : beanDescriptor.draftTable();
}
/**
@@ -1248,7 +1198,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
/**
* Return the version in long form (if set).
*/
- public long getVersion() {
+ public long version() {
return version;
}
@@ -1321,7 +1271,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
*/
public long now() {
if (now == 0) {
- now = ebeanServer.clockNow();
+ now = server.clockNow();
}
return now;
}
@@ -1338,7 +1288,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
*/
@Override
public void profile() {
- profileBase(type.profileEventId, profileOffset, beanDescriptor.getName(), 1);
+ profileBase(type.profileEventId, profileOffset, beanDescriptor.name(), 1);
}
/**
@@ -1391,15 +1341,15 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
String key = beanDescriptor.cacheKey(idValue);
Map changes = new LinkedHashMap<>();
- EntityBean bean = getEntityBean();
- boolean[] dirtyProperties = getDirtyProperties();
+ EntityBean bean = entityBean();
+ boolean[] dirtyProperties = dirtyProperties();
if (dirtyProperties != null) {
for (int i = 0; i < dirtyProperties.length; i++) {
if (dirtyProperties[i]) {
BeanProperty property = beanDescriptor.propertyByIndex(i);
if (property.isCacheDataInclude()) {
Object val = property.getCacheDataValue(bean);
- changes.put(property.getName(), val);
+ changes.put(property.name(), val);
if (property.isNaturalKey()) {
updateNaturalKey = true;
String valStr = (val == null) ? null : val.toString();
@@ -1413,7 +1363,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
// add element collection update
changes.putAll(collectionChanges);
}
- changeSet.addBeanUpdate(beanDescriptor, key, changes, updateNaturalKey, getVersion());
+ changeSet.addBeanUpdate(beanDescriptor, key, changes, updateNaturalKey, version());
}
}
@@ -1427,7 +1377,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
}
}
- public EntityBean getImportedOrphanForRemoval() {
+ public EntityBean importedOrphanForRemoval() {
return orphanBean;
}
@@ -1435,7 +1385,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
* Return the SQL used to fetch the last inserted id value.
*/
public String getSelectLastInsertedId() {
- return beanDescriptor.getSelectLastInsertedId(publish);
+ return beanDescriptor.selectLastInsertedId(publish);
}
/**
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestCallableSql.java b/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestCallableSql.java
index 806691f5f..1edabf5bd 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestCallableSql.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestCallableSql.java
@@ -19,20 +19,15 @@ import java.util.List;
public final class PersistRequestCallableSql extends PersistRequest {
private final SpiCallableSql callableSql;
-
private int rowCount;
-
private String bindLog;
-
private CallableStatement cstmt;
-
private BindParams bindParam;
/**
* Create.
*/
public PersistRequestCallableSql(SpiEbeanServer server, CallableSql cs, SpiTransaction t, PersistExecute persistExecute) {
-
super(server, t, persistExecute, cs.getLabel());
this.type = PersistRequest.Type.CALLABLESQL;
this.callableSql = (SpiCallableSql) cs;
@@ -56,7 +51,7 @@ public final class PersistRequestCallableSql extends PersistRequest {
/**
* Return the CallableSql.
*/
- public SpiCallableSql getCallableSql() {
+ public SpiCallableSql callableSql() {
return callableSql;
}
@@ -97,13 +92,11 @@ public final class PersistRequestCallableSql extends PersistRequest {
// register table modifications with the transaction event
TransactionEventTable tableEvents = callableSql.getTransactionEventTable();
-
if (tableEvents != null && !tableEvents.isEmpty()) {
transaction.getEvent().add(tableEvents);
} else {
transaction.markNotQueryOnly();
}
-
}
/**
@@ -120,7 +113,6 @@ public final class PersistRequestCallableSql extends PersistRequest {
* Execute the statement in normal non batch mode.
*/
public int executeUpdate() throws SQLException {
-
// check to see if the execution has been overridden
// only works in non-batch mode
if (callableSql.executeOverride(cstmt)) {
@@ -129,20 +121,15 @@ public final class PersistRequestCallableSql extends PersistRequest {
// rowCount = callableSql.getRowCount();
// return rowCount;
}
-
rowCount = cstmt.executeUpdate();
-
// only read in non-batch mode
readOutParams();
-
return rowCount;
}
private void readOutParams() throws SQLException {
-
List list = bindParam.positionedParameters();
int pos = 0;
-
for (Param param : list) {
pos++;
if (param.isOutParam()) {
@@ -151,5 +138,4 @@ public final class PersistRequestCallableSql extends PersistRequest {
}
}
}
-
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestOrmUpdate.java b/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestOrmUpdate.java
index 807feadd8..08de8e27d 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestOrmUpdate.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestOrmUpdate.java
@@ -14,19 +14,11 @@ import io.ebeaninternal.server.persist.PersistExecute;
public final class PersistRequestOrmUpdate extends PersistRequest {
private final BeanDescriptor> beanDescriptor;
-
private final SpiUpdate> ormUpdate;
-
private int rowCount;
-
private String bindLog;
- /**
- * Create.
- */
- public PersistRequestOrmUpdate(SpiEbeanServer server, BeanManager> mgr, SpiUpdate> ormUpdate,
- SpiTransaction t, PersistExecute persistExecute) {
-
+ public PersistRequestOrmUpdate(SpiEbeanServer server, BeanManager> mgr, SpiUpdate> ormUpdate, SpiTransaction t, PersistExecute persistExecute) {
super(server, t, persistExecute, ormUpdate.getLabel());
this.beanDescriptor = mgr.getBeanDescriptor();
this.ormUpdate = ormUpdate;
@@ -34,10 +26,10 @@ public final class PersistRequestOrmUpdate extends PersistRequest {
@Override
public void profile(long offset, int flushCount) {
- profileBase(EVT_ORMUPDATE, offset, beanDescriptor.getName(), flushCount);
+ profileBase(EVT_ORMUPDATE, offset, beanDescriptor.name(), flushCount);
}
- public BeanDescriptor> getBeanDescriptor() {
+ public BeanDescriptor> descriptor() {
return beanDescriptor;
}
@@ -51,11 +43,10 @@ public final class PersistRequestOrmUpdate extends PersistRequest {
return executeStatement();
}
-
/**
* Return the UpdateSql.
*/
- public SpiUpdate> getOrmUpdate() {
+ public SpiUpdate> ormUpdate() {
return ormUpdate;
}
@@ -91,14 +82,11 @@ public final class PersistRequestOrmUpdate extends PersistRequest {
}
OrmUpdateType ormUpdateType = ormUpdate.getOrmUpdateType();
String tableName = ormUpdate.getBaseTable();
-
if (transaction.isLogSummary()) {
String m = ormUpdateType + " table[" + tableName + "] rows[" + rowCount + "] bind[" + bindLog + "]";
transaction.logSummary(m);
}
-
if (ormUpdate.isNotifyCache()) {
-
// add the modification info to the TransactionEvent
// this is used to invalidate cached objects etc
switch (ormUpdateType) {
@@ -116,5 +104,4 @@ public final class PersistRequestOrmUpdate extends PersistRequest {
}
}
}
-
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestUpdateSql.java b/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestUpdateSql.java
index f16a9d7cd..63f31434a 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestUpdateSql.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/core/PersistRequestUpdateSql.java
@@ -18,25 +18,17 @@ public final class PersistRequestUpdateSql extends PersistRequest {
}
private final SpiSqlUpdate updateSql;
-
private int rowCount;
-
private String bindLog;
-
private SqlType sqlType;
-
private String tableName;
-
private boolean addBatch;
-
private final boolean forceNoBatch;
-
private boolean batchThisRequest;
private boolean flushQueue;
public PersistRequestUpdateSql(SpiEbeanServer server, SpiSqlUpdate sqlUpdate,
SpiTransaction t, PersistExecute persistExecute, boolean forceNoBatch) {
-
super(server, t, persistExecute, sqlUpdate.getLabel());
this.type = Type.UPDATESQL;
this.updateSql = sqlUpdate;
@@ -105,7 +97,7 @@ public final class PersistRequestUpdateSql extends PersistRequest {
/**
* Return the UpdateSql.
*/
- public SpiSqlUpdate getUpdateSql() {
+ public SpiSqlUpdate updateSql() {
return updateSql;
}
@@ -145,6 +137,7 @@ public final class PersistRequestUpdateSql extends PersistRequest {
this.bindLog = bindLog;
}
+ @Override
public void startBind(boolean batchThisRequest) {
this.batchThisRequest = batchThisRequest;
super.startBind(batchThisRequest);
@@ -170,7 +163,6 @@ public final class PersistRequestUpdateSql extends PersistRequest {
if (transaction.isLogSql() && !batchThisRequest) {
transaction.logSql(Str.add(TrimLogSql.trim(updateSql.getGeneratedSql()), "; -- bind(", bindLog, ") rows(", String.valueOf(rowCount), ")"));
}
-
if (updateSql.isAutoTableMod()) {
// add the modification info to the TransactionEvent
// this is used to invalidate cached objects etc
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/core/SpiOrmQueryRequest.java b/ebean-core/src/main/java/io/ebeaninternal/server/core/SpiOrmQueryRequest.java
index 41cfff829..3c7139476 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/core/SpiOrmQueryRequest.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/core/SpiOrmQueryRequest.java
@@ -22,12 +22,12 @@ public interface SpiOrmQueryRequest extends BeanQueryRequest, DocQueryRequ
* Return the query.
*/
@Override
- SpiQuery getQuery();
+ SpiQuery query();
/**
* Return the associated BeanDescriptor.
*/
- BeanDescriptor getBeanDescriptor();
+ BeanDescriptor descriptor();
/**
* Prepare the query for execution.
@@ -145,12 +145,12 @@ public interface SpiOrmQueryRequest extends BeanQueryRequest, DocQueryRequ
/**
* Return the bean cache hits (when all hits / no misses).
*/
- List getBeanCacheHits();
+ List beanCacheHits();
/**
* Return the bean cache hits for findMap (when all hits / no misses).
*/
- Map getBeanCacheHitsAsMap();
+ Map beanCacheHitsAsMap();
/**
* Reset Bean cache mode AUTO - require explicit setting for bean cache use with findList().
@@ -160,7 +160,7 @@ public interface SpiOrmQueryRequest extends BeanQueryRequest, DocQueryRequ
/**
* Return the Database platform like clause.
*/
- String getDBLikeClause(boolean rawLikeExpression);
+ String dbLikeClause(boolean rawLikeExpression);
/**
* Escapes a string to use it as exact match in Like clause.
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/AssocOneHelpRefExported.java b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/AssocOneHelpRefExported.java
index cf2f00f28..8b2fbe7bd 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/AssocOneHelpRefExported.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/AssocOneHelpRefExported.java
@@ -13,7 +13,7 @@ final class AssocOneHelpRefExported extends AssocOneHelp {
AssocOneHelpRefExported(BeanPropertyAssocOne> property) {
super(property);
this.softDelete = property.targetDescriptor.isSoftDelete();
- this.softDeletePredicate = (softDelete) ? property.targetDescriptor.getSoftDeletePredicate("") : null;
+ this.softDeletePredicate = (softDelete) ? property.targetDescriptor.softDeletePredicate("") : null;
}
/**
@@ -22,7 +22,7 @@ final class AssocOneHelpRefExported extends AssocOneHelp {
@Override
void appendSelect(DbSqlContext ctx, boolean subQuery) {
// set appropriate tableAlias for the exported id columns
- String relativePrefix = ctx.getRelativePrefix(property.getName());
+ String relativePrefix = ctx.getRelativePrefix(property.name());
ctx.pushTableAlias(relativePrefix);
property.targetIdBinder.appendSelect(ctx, subQuery);
ctx.popTableAlias();
@@ -30,7 +30,7 @@ final class AssocOneHelpRefExported extends AssocOneHelp {
@Override
void appendFrom(DbSqlContext ctx, SqlJoinType joinType) {
- String relativePrefix = ctx.getRelativePrefix(property.getName());
+ String relativePrefix = ctx.getRelativePrefix(property.name());
if (softDelete && !ctx.isIncludeSoftDelete()) {
property.tableJoin.addJoin(joinType, relativePrefix, ctx, softDeletePredicate);
} else {
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/AssocOneHelpRefInherit.java b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/AssocOneHelpRefInherit.java
index 3018b7e19..3a471f666 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/AssocOneHelpRefInherit.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/AssocOneHelpRefInherit.java
@@ -70,7 +70,7 @@ final class AssocOneHelpRefInherit extends AssocOneHelp {
void appendSelect(DbSqlContext ctx, boolean subQuery) {
if (!subQuery) {
// add discriminator column
- String relativePrefix = ctx.getRelativePrefix(property.getName());
+ String relativePrefix = ctx.getRelativePrefix(property.name());
String tableAlias = ctx.getTableAlias(relativePrefix);
ctx.appendColumn(tableAlias, property.targetInheritInfo.getDiscriminatorColumn());
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BaseCollectionHelp.java b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BaseCollectionHelp.java
index a803e1754..817f4e1de 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BaseCollectionHelp.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BaseCollectionHelp.java
@@ -17,8 +17,8 @@ abstract class BaseCollectionHelp implements BeanCollectionHelp {
BaseCollectionHelp(BeanPropertyAssocMany many) {
this.many = many;
- this.targetDescriptor = many.getTargetDescriptor();
- this.propertyName = many.getName();
+ this.targetDescriptor = many.targetDescriptor();
+ this.propertyName = many.name();
}
BaseCollectionHelp() {
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanChangeJson.java b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanChangeJson.java
index a4cb98e94..66b3faa45 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanChangeJson.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanChangeJson.java
@@ -54,10 +54,10 @@ final class BeanChangeJson implements BeanDiffVisitor {
public void visitPush(int position) {
stack.push(descriptor);
BeanPropertyAssocOne> embedded = (BeanPropertyAssocOne>)descriptor.propertiesIndex[position];
- descriptor = embedded.getTargetDescriptor();
- newJson.writeStartObject(embedded.getName());
+ descriptor = embedded.targetDescriptor();
+ newJson.writeStartObject(embedded.name());
if (oldJson != null) {
- oldJson.writeStartObject(embedded.getName());
+ oldJson.writeStartObject(embedded.name());
}
}
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanCollectionHelpFactory.java b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanCollectionHelpFactory.java
index c3bda06be..c0ce6c264 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanCollectionHelpFactory.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanCollectionHelpFactory.java
@@ -22,7 +22,7 @@ public final class BeanCollectionHelpFactory {
*/
public static BeanCollectionHelp create(BeanPropertyAssocMany many) {
boolean elementCollection = many.isElementCollection();
- ManyType manyType = many.getManyType();
+ ManyType manyType = many.manyType();
switch (manyType) {
case LIST:
return elementCollection ? new BeanListHelpElement<>(many) : new BeanListHelp<>(many);
@@ -44,8 +44,8 @@ public final class BeanCollectionHelpFactory {
return SET_HELP;
} else if (manyType == SpiQuery.Type.MAP) {
- BeanDescriptor target = request.getBeanDescriptor();
- ElPropertyValue elProperty = target.getElGetValue(request.getQuery().getMapKey());
+ BeanDescriptor target = request.descriptor();
+ ElPropertyValue elProperty = target.elGetValue(request.query().getMapKey());
return new BeanMapQueryHelp<>(elProperty);
} else {
diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanDescriptor.java b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanDescriptor.java
index 6541cade1..0635d5e06 100644
--- a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanDescriptor.java
+++ b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanDescriptor.java
@@ -352,7 +352,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
this.idOnlyReference = isIdOnlyReference(propertiesBaseScalar);
boolean noRelationships = propertiesOne.length + propertiesMany.length == 0;
this.cacheSharableBeans = noRelationships && deploy.getCacheOptions().isReadOnly();
- this.cacheHelp = new BeanDescriptorCacheHelp<>(this, owner.getCacheManager(), deploy.getCacheOptions(), cacheSharableBeans, propertiesOneImported);
+ this.cacheHelp = new BeanDescriptorCacheHelp<>(this, owner.cacheManager(), deploy.getCacheOptions(), cacheSharableBeans, propertiesOneImported);
this.jsonHelp = initJsonHelp();
this.draftHelp = new BeanDescriptorDraftHelp<>(this);
this.docStoreAdapter = owner.createDocStoreBeanAdapter(this, deploy);
@@ -380,8 +380,8 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
this.propertiesIndex = new BeanProperty[0];
} else {
EntityBeanIntercept ebi = prototypeEntityBean._ebean_getIntercept();
- this.idPropertyIndex = (idProperty == null) ? -1 : ebi.findProperty(idProperty.getName());
- this.versionPropertyIndex = (versionProperty == null) ? -1 : ebi.findProperty(versionProperty.getName());
+ this.idPropertyIndex = (idProperty == null) ? -1 : ebi.findProperty(idProperty.name());
+ this.versionPropertyIndex = (versionProperty == null) ? -1 : ebi.findProperty(versionProperty.name());
this.unloadProperties = derivePropertiesToUnload(prototypeEntityBean);
this.propertiesIndex = new BeanProperty[ebi.getPropertyLength()];
for (int i = 0; i < propertiesIndex.length; i++) {
@@ -452,8 +452,8 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the DatabaseConfig.
*/
- public DatabaseConfig getConfig() {
- return owner.getConfig();
+ public DatabaseConfig config() {
+ return owner.config();
}
/**
@@ -470,7 +470,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the EbeanServer instance that owns this BeanDescriptor.
*/
- public SpiEbeanServer getEbeanServer() {
+ public SpiEbeanServer ebeanServer() {
return ebeanServer;
}
@@ -492,11 +492,11 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the type of this domain object.
*/
- public EntityType getEntityType() {
+ public EntityType entityType() {
return entityType;
}
- private String[] getProperties() {
+ private String[] properties() {
return properties;
}
@@ -545,7 +545,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
for (BeanPropertyAssocMany> manyToMany : propertiesManyToMany) {
// register associated history table for M2M intersection
if (!manyToMany.isExcludedFromHistory()) {
- TableJoin intersectionTableJoin = manyToMany.getIntersectionTableJoin();
+ TableJoin intersectionTableJoin = manyToMany.intersectionTableJoin();
initContext.addHistoryIntersection(intersectionTableJoin.getTable());
}
}
@@ -570,8 +570,8 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
whereIdInSql = " where " + idBinderInLHSSqlNoAlias + " ";
deleteByIdInSql = "delete from " + baseTable + whereIdInSql;
if (softDelete) {
- softDeleteByIdSql = "update " + baseTable + " set " + getSoftDeleteDbSet() + " where " + idEqualsSql;
- softDeleteByIdInSql = "update " + baseTable + " set " + getSoftDeleteDbSet() + " where " + idBinderInLHSSqlNoAlias + " ";
+ softDeleteByIdSql = "update " + baseTable + " set " + softDeleteDbSet() + " where " + idEqualsSql;
+ softDeleteByIdInSql = "update " + baseTable + " set " + softDeleteDbSet() + " where " + idBinderInLHSSqlNoAlias + " ";
} else {
softDeleteByIdSql = null;
softDeleteByIdInSql = null;
@@ -584,7 +584,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
if (naturalKey != null && naturalKey.length != 0) {
BeanProperty[] props = new BeanProperty[naturalKey.length];
for (int i = 0; i < naturalKey.length; i++) {
- props[i] = getBeanProperty(naturalKey[i]);
+ props[i] = beanProperty(naturalKey[i]);
}
this.beanNaturalKey = new BeanNaturalKey(naturalKey, props);
}
@@ -601,7 +601,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
boolean hasCircularImportedIdTo(BeanDescriptor> sourceDesc) {
for (BeanPropertyAssocOne> assocOne : propertiesOneImportedSave) {
- if (assocOne.getTargetDescriptor() == sourceDesc) {
+ if (assocOne.targetDescriptor() == sourceDesc) {
return true;
}
}
@@ -731,10 +731,10 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
EntityBeanIntercept fromEbi = bean._ebean_getIntercept();
EntityBeanIntercept toEbi = existing._ebean_getIntercept();
int propertyLength = toEbi.getPropertyLength();
- String[] names = getProperties();
+ String[] names = properties();
for (int i = 0; i < propertyLength; i++) {
if (fromEbi.isLoadedProperty(i)) {
- BeanProperty property = getBeanProperty(names[i]);
+ BeanProperty property = beanProperty(names[i]);
if (!toEbi.isLoadedProperty(i)) {
Object val = property.getValue(bean);
property.setValue(existing, val);
@@ -758,15 +758,15 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the ReadAuditLogger for logging read audit events.
*/
- public ReadAuditLogger getReadAuditLogger() {
- return ebeanServer.getReadAuditLogger();
+ public ReadAuditLogger readAuditLogger() {
+ return ebeanServer.readAuditLogger();
}
/**
* Return the ReadAuditPrepare for preparing read audit events prior to logging.
*/
- private ReadAuditPrepare getReadAuditPrepare() {
- return ebeanServer.getReadAuditPrepare();
+ private ReadAuditPrepare readAuditPrepare() {
+ return ebeanServer.readAuditPrepare();
}
public boolean isChangeLog() {
@@ -776,8 +776,8 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return true if this request should be included in the change log.
*/
- public BeanChange getChangeLogBean(PersistRequestBean request) {
- switch (request.getType()) {
+ public BeanChange changeLogBean(PersistRequestBean request) {
+ switch (request.type()) {
case INSERT:
return changeLogFilter.includeInsert(request) ? insertBeanChange(request) : null;
case UPDATE:
@@ -786,7 +786,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
case DELETE:
return changeLogFilter.includeDelete(request) ? deleteBeanChange(request) : null;
default:
- throw new IllegalStateException("Unhandled request type " + request.getType());
+ throw new IllegalStateException("Unhandled request type " + request.type());
}
}
@@ -799,7 +799,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Return the bean change for a delete.
*/
private BeanChange deleteBeanChange(PersistRequestBean request) {
- return beanChange(ChangeType.DELETE, request.getBeanId(), null, null);
+ return beanChange(ChangeType.DELETE, request.beanId(), null, null);
}
/**
@@ -808,9 +808,9 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
private BeanChange updateBeanChange(PersistRequestBean request) {
try {
BeanChangeJson changeJson = new BeanChangeJson(this, request.isStatelessUpdate());
- request.getEntityBeanIntercept().addDirtyPropertyValues(changeJson);
+ request.intercept().addDirtyPropertyValues(changeJson);
changeJson.flush();
- return beanChange(ChangeType.UPDATE, request.getBeanId(), changeJson.newJson(), changeJson.oldJson());
+ return beanChange(ChangeType.UPDATE, request.beanId(), changeJson.newJson(), changeJson.oldJson());
} catch (RuntimeException e) {
logger.error("Failed to write ChangeLog entry for update", e);
return null;
@@ -824,9 +824,9 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
try {
StringWriter writer = new StringWriter(200);
SpiJsonWriter jsonWriter = createJsonWriter(writer);
- jsonWriteForInsert(jsonWriter, request.getEntityBean());
+ jsonWriteForInsert(jsonWriter, request.entityBean());
jsonWriter.flush();
- return beanChange(ChangeType.INSERT, request.getBeanId(), writer.toString(), null);
+ return beanChange(ChangeType.INSERT, request.beanId(), writer.toString(), null);
} catch (IOException e) {
logger.error("Failed to write ChangeLog entry for insert", e);
return null;
@@ -869,14 +869,14 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the "where id in" sql (for use with UpdateQuery).
*/
- public String getWhereIdInSql() {
+ public String whereIdInSql() {
return whereIdInSql;
}
/**
* Return the "delete by id" sql.
*/
- public String getDeleteByIdInSql() {
+ public String deleteByIdInSql() {
return deleteByIdInSql;
}
@@ -913,7 +913,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* foreign keys don't require an extra join.
*/
public void add(BeanFkeyProperty fkey) {
- elDeployCache.put(fkey.getName(), fkey);
+ elDeployCache.put(fkey.name(), fkey);
}
void initialiseFkeys() {
@@ -927,33 +927,33 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the cache options.
*/
- public CacheOptions getCacheOptions() {
+ public CacheOptions cacheOptions() {
return cacheHelp.getCacheOptions();
}
/**
* Return the Encrypt key given the BeanProperty.
*/
- public EncryptKey getEncryptKey(BeanProperty p) {
- return owner.getEncryptKey(baseTable, p.getDbColumn());
+ public EncryptKey encryptKey(BeanProperty p) {
+ return owner.encryptKey(baseTable, p.dbColumn());
}
/**
* Return the Encrypt key given the table and column name.
*/
- public EncryptKey getEncryptKey(String tableName, String columnName) {
- return owner.getEncryptKey(tableName, columnName);
+ public EncryptKey encryptKey(String tableName, String columnName) {
+ return owner.encryptKey(tableName, columnName);
}
/**
* Return the Scalar type for the given JDBC type.
*/
- public ScalarType> getScalarType(int jdbcType) {
- return owner.getScalarType(jdbcType);
+ public ScalarType> scalarType(int jdbcType) {
+ return owner.scalarType(jdbcType);
}
- public ScalarType> getScalarType(String cast) {
- return owner.getScalarType(cast);
+ public ScalarType> scalarType(String cast) {
+ return owner.scalarType(cast);
}
/**
@@ -967,7 +967,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the default select clause.
*/
- public String getDefaultSelectClause() {
+ public String defaultSelectClause() {
return defaultSelectClause;
}
@@ -999,12 +999,12 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Return the queueId used to uniquely identify this type when queuing an index updateAdd.
*/
@Override
- public String getDocStoreQueueId() {
+ public String docStoreQueueId() {
return docStoreQueueId;
}
@Override
- public DocumentMapping getDocMapping() {
+ public DocumentMapping docMapping() {
return docMapping;
}
@@ -1067,7 +1067,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
*/
public String rootName() {
if (inheritInfo != null && !inheritInfo.isRoot()) {
- return inheritInfo.getRoot().desc().getName();
+ return inheritInfo.getRoot().desc().name();
}
return name;
}
@@ -1075,14 +1075,14 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the named ORM query.
*/
- public String getNamedQuery(String name) {
+ public String namedQuery(String name) {
return namedQuery.get(name);
}
/**
* Return the named RawSql query.
*/
- public SpiRawSql getNamedRawSql(String named) {
+ public SpiRawSql namedRawSql(String named) {
return namedRawSql.get(named);
}
@@ -1090,7 +1090,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Return the type of DocStoreMode that should occur for this type of persist request
* given the transactions requested mode.
*/
- public DocStoreMode getDocStoreMode(PersistRequest.Type persistType, DocStoreMode txnMode) {
+ public DocStoreMode docStoreMode(PersistRequest.Type persistType, DocStoreMode txnMode) {
return docStoreAdapter.getMode(persistType, txnMode);
}
@@ -1127,7 +1127,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the draft dirty boolean property or null if there is not one assigned to this bean type.
*/
- BeanProperty getDraftDirty() {
+ BeanProperty draftDirty() {
return draftDirty;
}
@@ -1149,7 +1149,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the natural key.
*/
- public BeanNaturalKey getNaturalKey() {
+ public BeanNaturalKey naturalKey() {
return beanNaturalKey;
}
@@ -1421,13 +1421,13 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Write a bean read to the read audit log.
*/
public void readAuditBean(String queryKey, String bindLog, Object bean) {
- ReadEvent event = new ReadEvent(fullName, queryKey, bindLog, getIdForJson(bean));
+ ReadEvent event = new ReadEvent(fullName, queryKey, bindLog, idForJson(bean));
readAuditPrepare(event);
- getReadAuditLogger().auditBean(event);
+ readAuditLogger().auditBean(event);
}
private void readAuditPrepare(ReadEvent event) {
- ReadAuditPrepare prepare = getReadAuditPrepare();
+ ReadAuditPrepare prepare = readAuditPrepare();
if (prepare != null) {
prepare.prepare(event);
}
@@ -1439,7 +1439,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
public void readAuditMany(String queryKey, String bindLog, List ids) {
ReadEvent event = new ReadEvent(fullName, queryKey, bindLog, ids);
readAuditPrepare(event);
- getReadAuditLogger().auditMany(event);
+ readAuditLogger().auditMany(event);
}
/**
@@ -1447,13 +1447,13 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
*/
public void readAuditFutureMany(ReadEvent event) {
// this has already been prepared (in foreground thread)
- getReadAuditLogger().auditMany(event);
+ readAuditLogger().auditMany(event);
}
/**
* Return the base table alias. This is always the first letter of the bean name.
*/
- public String getBaseTableAlias() {
+ public String baseTableAlias() {
return baseTableAlias;
}
@@ -1530,32 +1530,32 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
}
}
- public CQueryPlan getQueryPlan(CQueryPlanKey key) {
+ public CQueryPlan queryPlan(CQueryPlanKey key) {
return queryPlanCache.get(key);
}
- public void putQueryPlan(CQueryPlanKey key, CQueryPlan plan) {
+ public void queryPlan(CQueryPlanKey key, CQueryPlan plan) {
queryPlanCache.put(key, plan);
}
/**
* Get a UpdatePlan for a given hash.
*/
- public SpiUpdatePlan getUpdatePlan(String key) {
+ public SpiUpdatePlan updatePlan(String key) {
return updatePlanCache.get(key);
}
/**
* Add a UpdatePlan to the cache with a given hash.
*/
- public void putUpdatePlan(String key, SpiUpdatePlan plan) {
+ public void updatePlan(String key, SpiUpdatePlan plan) {
updatePlanCache.put(key, plan);
}
/**
* Return a Sql update statement to set the importedId value (deferred execution).
*/
- public String getUpdateImportedIdSql(ImportedId prop) {
+ public String updateImportedIdSql(ImportedId prop) {
return "update " + baseTable + " set " + prop.importedIdClause() + " where " + idBinder.getBindIdSql(null);
}
@@ -1597,7 +1597,7 @@ public class BeanDescriptor implements BeanType