diff --git a/ebean-api/pom.xml b/ebean-api/pom.xml
index b6adad05d..b8cd099a2 100644
--- a/ebean-api/pom.xml
+++ b/ebean-api/pom.xml
@@ -4,7 +4,7 @@
ebean-parent
io.ebean
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
ebean api
@@ -27,7 +27,7 @@
io.avaje
avaje-config
- 1.3
+ 1.4
@@ -14,7 +14,7 @@
scm:git:git@github.com:ebean-orm/ebean.git
- ebean-parent-12.8.0
+ ebean-parent-12.11.4
ebean autotune
@@ -26,7 +26,7 @@
io.ebean
ebean-core
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
provided
@@ -46,9 +46,9 @@
- org.avaje.composite
+ io.avaje
junit
- 1.1
+ 1.0
test
@@ -59,12 +59,12 @@
io.repaint.maven
tiles-maven-plugin
- 2.19
+ 2.24
true
- 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-parent
io.ebean
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
ebean bom
@@ -71,88 +71,88 @@
io.ebean
ebean
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
io.ebean
ebean-api
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
io.ebean
ebean-core
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
io.ebean
ebean-core-type
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
io.ebean
ebean-ddl-generator
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
io.ebean
ebean-externalmapping-api
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
io.ebean
ebean-externalmapping-xml
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
io.ebean
ebean-autotune
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
io.ebean
ebean-querybean
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
io.ebean
querybean-generator
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
provided
io.ebean
kotlin-querybean-generator
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
provided
io.ebean
ebean-test
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
test
io.ebean
ebean-postgis
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
io.ebean
ebean-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-parent
io.ebean
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
ebean-core-type
@@ -16,7 +16,7 @@
io.ebean
ebean-api
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
diff --git a/ebean-core/pom.xml b/ebean-core/pom.xml
index 66eb107fb..cf6b1ae1b 100644
--- a/ebean-core/pom.xml
+++ b/ebean-core/pom.xml
@@ -3,7 +3,7 @@
ebean-parent
io.ebean
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
ebean-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.ebean
ebean-ddl-runner
- 1.0
+ 1.2
io.avaje
classpath-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.ebean
ebean-api
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
io.ebean
ebean-core-type
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
io.ebean
ebean-externalmapping-api
- 12.11.2-SNAPSHOT
+ 12.11.5-SNAPSHOT
@@ -105,8 +68,8 @@
-->
io.avaje
- avaje-jsr305
- 1.0
+ avaje-jsr305-x
+ 1.1
provided
@@ -121,8 +84,8 @@
javax.transaction
- jta
- 1.1
+ javax.transaction-api
+ 1.3
true
@@ -130,7 +93,7 @@
javax.validation
validation-api
- 1.1.0.Final
+ 2.0.1.Final
true
@@ -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.0
test
-
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
*/
- 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);
}
@@ -694,7 +644,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);
}
/**
@@ -739,14 +689,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;
}
@@ -754,21 +704,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
@@ -783,7 +733,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;
@@ -802,7 +752,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
@@ -854,7 +804,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) {
throw new OptimisticLockException("Data has changed. updated row count " + rowCount, null, bean);
@@ -905,7 +855,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);
}
@@ -937,8 +887,8 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
}
addPostCommitListeners();
notifyCacheOnPostExecute();
- if (isLogSummary()) {
- logSummary();
+ if (logSummary()) {
+ logSummaryMessage();
}
}
@@ -985,9 +935,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);
@@ -1021,9 +971,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());
}
}
@@ -1031,7 +981,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() {
@@ -1074,7 +1024,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;
}
@@ -1151,9 +1101,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;
@@ -1175,7 +1125,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;
}
@@ -1183,7 +1133,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;
}
@@ -1197,16 +1147,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');
}
}
@@ -1219,8 +1169,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();
}
/**
@@ -1240,7 +1190,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;
}
@@ -1313,7 +1263,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
*/
public long now() {
if (now == 0) {
- now = ebeanServer.clockNow();
+ now = server.clockNow();
}
return now;
}
@@ -1330,7 +1280,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);
}
/**
@@ -1383,15 +1333,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();
@@ -1405,7 +1355,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());
}
}
@@ -1419,7 +1369,7 @@ public final class PersistRequestBean extends PersistRequest implements BeanP
}
}
- public EntityBean getImportedOrphanForRemoval() {
+ public EntityBean importedOrphanForRemoval() {
return orphanBean;
}
@@ -1427,7 +1377,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, STreeType, SpiBeanType {
* Return the 'when modified' property if there is one defined.
*/
@Override
- public BeanProperty getWhenModifiedProperty() {
+ public BeanProperty whenModifiedProperty() {
return whenModifiedProperty;
}
@@ -1605,7 +1605,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Return the 'when created' property if there is one defined.
*/
@Override
- public BeanProperty getWhenCreatedProperty() {
+ public BeanProperty whenCreatedProperty() {
return whenCreatedProperty;
}
@@ -1636,10 +1636,10 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the many property included in the query or null if one is not.
*/
- public BeanPropertyAssocMany> getManyProperty(SpiQuery> query) {
+ public BeanPropertyAssocMany> manyProperty(SpiQuery> query) {
OrmQueryDetail detail = query.getDetail();
for (BeanPropertyAssocMany> many : propertiesMany) {
- if (detail.includesPath(many.getName())) {
+ if (detail.includesPath(many.name())) {
return many;
}
}
@@ -1649,7 +1649,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return a raw expression for 'where parent id in ...' clause.
*/
- String getParentIdInExpr(int parentIdSize, String rawWhere) {
+ String parentIdInExpr(int parentIdSize, String rawWhere) {
String inClause = idBinder.getIdInValueExpr(false, parentIdSize);
return idBinder.isIdInExpandedForm() ? inClause : rawWhere + inClause;
}
@@ -1658,7 +1658,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Return the IdBinder which is helpful for handling the various types of Id.
*/
@Override
- public IdBinder getIdBinder() {
+ public IdBinder idBinder() {
return idBinder;
}
@@ -1699,7 +1699,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Return the sql for binding an id. This is the columns with table alias that
* make up the id.
*/
- public String getIdBinderIdSql(String alias) {
+ public String idBinderIdSql(String alias) {
if (alias == null) {
return idBinderIdSql;
} else {
@@ -1710,7 +1710,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the sql for binding id's using an IN clause.
*/
- public String getIdBinderInLHSSql() {
+ public String idBinderInLHSSql() {
return idBinderInLHSSql;
}
@@ -1728,7 +1728,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
*
* This 'flattens' any EmbeddedId or multiple Id property cases.
*/
- public Object[] getBindIdValues(Object idValue) {
+ public Object[] bindIdValues(Object idValue) {
return idBinder.getBindValues(idValue);
}
@@ -1747,7 +1747,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
*/
private EntityBean createEntityBean(boolean isNew) {
if (prototypeEntityBean == null) {
- throw new UnsupportedOperationException("cannot create entity bean for abstract entity " + getName());
+ throw new UnsupportedOperationException("cannot create entity bean for abstract entity " + name());
}
try {
EntityBean bean = (EntityBean) prototypeEntityBean._ebean_newInstance();
@@ -1793,7 +1793,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* We actually need to do a query because we don't know the type without the discriminator value.
*/
private T findReferenceBean(Object id, PersistenceContext pc) {
- DefaultOrmQuery query = new DefaultOrmQuery<>(this, ebeanServer, ebeanServer.getExpressionFactory());
+ DefaultOrmQuery query = new DefaultOrmQuery<>(this, ebeanServer, ebeanServer.expressionFactory());
query.setPersistenceContext(pc);
return query.setId(id).findOne();
}
@@ -1904,21 +1904,21 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
if (assocProp == null) {
throw new IllegalStateException("Unknown property path [" + split[0] + "] from[" + path + "]");
}
- BeanDescriptor> targetDesc = assocProp.getTargetDescriptor();
+ BeanDescriptor> targetDesc = assocProp.targetDescriptor();
path = split[1];
other = targetDesc;
}
}
@Override
- public BeanType> getBeanTypeAtPath(String path) {
- return getBeanDescriptor(path);
+ public BeanType> beanTypeAtPath(String path) {
+ return descriptor(path);
}
/**
* Return the BeanDescriptor for a given path of Associated One or Many beans.
*/
- public BeanDescriptor> getBeanDescriptor(String path) {
+ public BeanDescriptor> descriptor(String path) {
BeanDescriptor> result = this;
while (true) {
if (path == null) {
@@ -1929,9 +1929,9 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
if (beanProperty instanceof BeanPropertyAssoc>) {
BeanPropertyAssoc> assocProp = (BeanPropertyAssoc>) beanProperty;
path = splitBegin[1];
- result = assocProp.getTargetDescriptor();
+ result = assocProp.targetDescriptor();
} else {
- throw new PersistenceException("Invalid path " + path + " from " + result.getFullName());
+ throw new PersistenceException("Invalid path " + path + " from " + result.fullName());
}
}
}
@@ -1939,8 +1939,8 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the BeanDescriptor of another bean type.
*/
- public BeanDescriptor getBeanDescriptor(Class otherType) {
- return owner.getBeanDescriptor(otherType);
+ public BeanDescriptor descriptor(Class otherType) {
+ return owner.descriptor(otherType);
}
/**
@@ -1953,7 +1953,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the order column property.
*/
- public BeanProperty getOrderColumn() {
+ public BeanProperty orderColumn() {
return orderColumn;
}
@@ -1964,7 +1964,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* relationships we have this 'shadow' property which is not externally
* visible.
*/
- public BeanPropertyAssocOne> getUnidirectional() {
+ public BeanPropertyAssocOne> unidirectional() {
BeanDescriptor> other = this;
while (true) {
if (other.unidirectional != null) {
@@ -1991,7 +1991,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return bean class name.
*/
- public String getDescriptorId() {
+ public String descriptorId() {
return fullName;
}
@@ -2000,7 +2000,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
*/
@Override
@Nonnull
- public Class getBeanType() {
+ public Class type() {
return beanType;
}
@@ -2012,7 +2012,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
*/
@Override
@Nonnull
- public String getFullName() {
+ public String fullName() {
return fullName;
}
@@ -2021,14 +2021,14 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
*/
@Override
@Nonnull
- public String getName() {
+ public String name() {
return name;
}
/**
* Return the simple name of the entity bean.
*/
- public String getSimpleName() {
+ public String simpleName() {
return beanType.getSimpleName();
}
@@ -2093,8 +2093,8 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the Id property name or null if no Id property exists.
*/
- public String getIdName() {
- return (idProperty == null) ? null : idProperty.getName();
+ public String idName() {
+ return (idProperty == null) ? null : idProperty.name();
}
/**
@@ -2122,7 +2122,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
}
@Override
- public Object beanId(Object bean) {
+ public Object id(Object bean) {
return getId((EntityBean) bean);
}
@@ -2136,7 +2136,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
*
* The usage is to provide simple id types for JSON processing (for embeddedId's).
*/
- public Object getIdForJson(Object bean) {
+ public Object idForJson(Object bean) {
return idBinder.getIdForJson((EntityBean) bean);
}
@@ -2153,7 +2153,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Return the default order by that may need to be added if a many property is
* included in the query.
*/
- public String getDefaultOrderBy() {
+ public String defaultOrderBy() {
return idBinder.getDefaultOrderBy();
}
@@ -2168,7 +2168,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Set the bean id value converting if necessary.
*/
@Override
- public void setBeanId(T bean, Object idValue) {
+ public void setId(T bean, Object idValue) {
idBinder.convertSetId(idValue, (EntityBean) bean);
}
@@ -2190,22 +2190,22 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
}
@Override
- public Property getProperty(String propName) {
+ public Property property(String propName) {
return findProperty(propName);
}
/**
* Get a BeanProperty by its name.
*/
- public BeanProperty getBeanProperty(String propName) {
+ public BeanProperty beanProperty(String propName) {
return propMap.get(propName);
}
public void sort(List list, String sortByClause) {
- list.sort(getElComparator(sortByClause));
+ list.sort(elComparator(sortByClause));
}
- public ElComparator getElComparator(String propNameOrSortBy) {
+ public ElComparator elComparator(String propNameOrSortBy) {
return comparatorCache.computeIfAbsent(propNameOrSortBy, this::createComparator);
}
@@ -2217,10 +2217,10 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
public void lazyLoadRegister(String prefix, EntityBeanIntercept ebi, EntityBean bean, LoadContext loadContext) {
// load the List/Set/Map proxy objects (deferred fetching of lists)
for (BeanPropertyAssocMany> many : propertiesMany()) {
- if (!ebi.isLoadedProperty(many.getPropertyIndex())) {
+ if (!ebi.isLoadedProperty(many.propertyIndex())) {
BeanCollection> ref = many.createReferenceIfNull(bean);
if (ref != null && !ref.isRegisteredWithLoadContext()) {
- String path = SplitName.add(prefix, many.getName());
+ String path = SplitName.add(prefix, many.name());
loadContext.register(path, many, ref);
}
}
@@ -2301,7 +2301,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
}
private ElComparator createPropertyComparator(SortByClause.Property sortProp) {
- ElPropertyValue elGetValue = getElGetValue(sortProp.getName());
+ ElPropertyValue elGetValue = elGetValue(sortProp.getName());
if (elGetValue == null) {
logger.error("Sort property [" + sortProp + "] not found in " + beanType + ". Cannot sort.");
return new ElComparatorNoop<>();
@@ -2320,7 +2320,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
@Override
public boolean isValidExpression(String propertyName) {
try {
- return (getElGetValue(propertyName) != null);
+ return (elGetValue(propertyName) != null);
} catch (PersistenceException e) {
return false;
}
@@ -2329,7 +2329,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Get an Expression language Value object.
*/
- public ElPropertyValue getElGetValue(String propName) {
+ public ElPropertyValue elGetValue(String propName) {
ElPropertyValue elGetValue = elCache.get(propName);
if (elGetValue != null) {
return elGetValue;
@@ -2342,8 +2342,8 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
}
@Override
- public ExpressionPath getExpressionPath(String path) {
- return getElGetValue(path);
+ public ExpressionPath expressionPath(String path) {
+ return elGetValue(path);
}
/**
@@ -2351,7 +2351,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
*
* The foreign key shortcuts means we can avoid unnecessary joins.
*/
- public ElPropertyDeploy getElPropertyDeploy(String propName) {
+ public ElPropertyDeploy elPropertyDeploy(String propName) {
ElPropertyDeploy elProp = elDeployCache.get(propName);
if (elProp != null) {
return elProp;
@@ -2359,7 +2359,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
if (!propName.contains(".")) {
// No period means simple property and no need to look for
// foreign key properties (in order to avoid an extra join)
- elProp = getElGetValue(propName);
+ elProp = elGetValue(propName);
} else {
elProp = buildElGetValue(propName, null, true);
}
@@ -2414,9 +2414,9 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
assocProperty = tablePath.get(schemaName + "." + tableName);
}
if (assocProperty != null) {
- String relativePath = assocProperty.getTargetDescriptor().findBeanPath(schemaName, tableName, columnName);
+ String relativePath = assocProperty.targetDescriptor().findBeanPath(schemaName, tableName, columnName);
if (relativePath != null) {
- return SplitName.add(assocProperty.getName(), relativePath);
+ return SplitName.add(assocProperty.name(), relativePath);
}
}
return null;
@@ -2510,7 +2510,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* of bean is not involved in any ORM inheritance mapping.
*/
@Override
- public InheritInfo getInheritInfo() {
+ public InheritInfo inheritInfo() {
return inheritInfo;
}
@@ -2520,14 +2520,14 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
}
@Override
- public String getDiscColumn() {
+ public String discColumn() {
return inheritInfo.getDiscriminatorColumn();
}
/**
* Return the discriminator value for this bean type (or null when there is no inheritance).
*/
- public String getDiscValue() {
+ public String discValue() {
return inheritInfo == null ? null : inheritInfo.getDiscriminatorStringValue();
}
@@ -2554,7 +2554,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the compound unique constraints.
*/
- public IndexDefinition[] getIndexDefinitions() {
+ public IndexDefinition[] indexDefinitions() {
return indexDefinitions;
}
@@ -2562,14 +2562,14 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Return the beanListener.
*/
@Override
- public BeanPersistListener getPersistListener() {
+ public BeanPersistListener persistListener() {
return persistListener;
}
/**
* Return the beanFinder (Migrate over to getFindController).
*/
- public BeanFindController getBeanFinder() {
+ public BeanFindController beanFinder() {
return beanFinder;
}
@@ -2577,7 +2577,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Return the find controller (SPI interface).
*/
@Override
- public BeanFindController getFindController() {
+ public BeanFindController findController() {
return beanFinder;
}
@@ -2585,7 +2585,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Return the BeanQueryAdapter or null if none is defined.
*/
@Override
- public BeanQueryAdapter getQueryAdapter() {
+ public BeanQueryAdapter queryAdapter() {
return queryAdapter;
}
@@ -2661,7 +2661,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Return the Controller.
*/
@Override
- public BeanPersistController getPersistController() {
+ public BeanPersistController persistController() {
return persistController;
}
@@ -2676,7 +2676,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the DB comment for the base table.
*/
- public String getDbComment() {
+ public String dbComment() {
return dbComment;
}
@@ -2690,21 +2690,21 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the partition details of the bean.
*/
- public PartitionMeta getPartitionMeta() {
+ public PartitionMeta partitionMeta() {
return partitionMeta;
}
/**
* Return the storage engine.
*/
- public String getStorageEngine() {
+ public String storageEngine() {
return storageEngine;
}
/**
* Return the dependent tables for a view based entity.
*/
- public String[] getDependentTables() {
+ public String[] dependentTables() {
return dependentTables;
}
@@ -2712,7 +2712,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Return the base table. Only properties mapped to the base table are by default persisted.
*/
@Override
- public String getBaseTable() {
+ public String baseTable() {
return baseTable;
}
@@ -2727,7 +2727,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Return the base table to use given the query temporal mode.
*/
@Override
- public String getBaseTable(SpiQuery.TemporalMode mode) {
+ public String baseTable(SpiQuery.TemporalMode mode) {
switch (mode) {
case DRAFT:
return draftTable;
@@ -2743,7 +2743,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
/**
* Return the associated draft table.
*/
- public String getDraftTable() {
+ public String draftTable() {
return draftTable;
}
@@ -2759,27 +2759,27 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
return softDelete;
}
- public void setSoftDeleteValue(EntityBean bean) {
+ public void softDeleteValue(EntityBean bean) {
softDeleteProperty.setSoftDeleteValue(bean);
}
- String getSoftDeleteDbSet() {
- return softDeleteProperty.getSoftDeleteDbSet();
+ String softDeleteDbSet() {
+ return softDeleteProperty.softDeleteDbSet();
}
@Override
- public String getSoftDeletePredicate(String tableAlias) {
- return softDeleteProperty.getSoftDeleteDbPredicate(tableAlias);
+ public String softDeletePredicate(String tableAlias) {
+ return softDeleteProperty.softDeleteDbPredicate(tableAlias);
}
@Override
public void markAsDeleted(EntityBean bean) {
if (softDeleteProperty == null) {
Object id = getId(bean);
- logger.info("(Lazy) loading unsuccessful for type:{} id:{} - expecting when bean has been deleted", getName(), id);
+ logger.info("(Lazy) loading unsuccessful for type:{} id:{} - expecting when bean has been deleted", name(), id);
bean._ebean_getIntercept().setLazyLoadFailure(id);
} else {
- setSoftDeleteValue(bean);
+ softDeleteValue(bean);
bean._ebean_getIntercept().setLoaded();
setAllLoaded(bean);
}
@@ -2801,18 +2801,18 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
@Override
public boolean isEmbeddedPath(String propertyPath) {
- ElPropertyDeploy elProp = getElPropertyDeploy(propertyPath);
+ ElPropertyDeploy elProp = elPropertyDeploy(propertyPath);
if (elProp == null) {
- throw new PersistenceException("Invalid path " + propertyPath + " from " + getFullName());
+ throw new PersistenceException("Invalid path " + propertyPath + " from " + fullName());
}
- return elProp.getBeanProperty().isEmbedded();
+ return elProp.beanProperty().isEmbedded();
}
@Override
public ExtraJoin extraJoin(String propertyPath) {
- ElPropertyValue elGetValue = getElGetValue(propertyPath);
+ ElPropertyValue elGetValue = elGetValue(propertyPath);
if (elGetValue != null) {
- BeanProperty beanProperty = elGetValue.getBeanProperty();
+ BeanProperty beanProperty = elGetValue.beanProperty();
if (beanProperty instanceof BeanPropertyAssoc>) {
BeanPropertyAssoc> assocProp = (BeanPropertyAssoc>) beanProperty;
if (!assocProp.isEmbedded()) {
@@ -2825,7 +2825,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
@Override
public void inheritanceLoad(SqlBeanLoad sqlBeanLoad, STreeProperty property, DbReadContext ctx) {
- BeanProperty p = getBeanProperty(property.getName());
+ BeanProperty p = beanProperty(property.name());
if (p != null) {
p.load(sqlBeanLoad);
} else {
@@ -2874,7 +2874,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
public boolean isToManyDirty(EntityBean bean) {
final EntityBeanIntercept ebi = bean._ebean_getIntercept();
for (BeanPropertyAssocMany> many : propertiesManySave) {
- if (ebi.isLoadedProperty(many.getPropertyIndex())) {
+ if (ebi.isLoadedProperty(many.propertyIndex())) {
final BeanCollection> value = (BeanCollection>) many.getValue(bean);
if (value != null && value.hasModifications()) {
return true;
@@ -2902,7 +2902,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
if (draftDirty != null) {
// check to see if the dirty property has already
// been set and if so do not set the value
- if (!entityBean._ebean_getIntercept().isChangedProperty(draftDirty.getPropertyIndex())) {
+ if (!entityBean._ebean_getIntercept().isChangedProperty(draftDirty.propertyIndex())) {
draftDirty.setValueIntercept(entityBean, value);
}
}
@@ -2929,7 +2929,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* Return the identity generation type.
*/
@Override
- public IdType getIdType() {
+ public IdType idType() {
return idType;
}
@@ -2952,7 +2952,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
return idGeneratedValue;
}
- public IdentityMode getIdentityMode() {
+ public IdentityMode identityMode() {
return identityMode;
}
@@ -2962,7 +2962,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* This is only used with Identity columns and getGeneratedKeys is not
* supported.
*/
- public String getSelectLastInsertedId(boolean publish) {
+ public String selectLastInsertedId(boolean publish) {
return publish ? selectLastInsertedId : selectLastInsertedIdDraft;
}
@@ -3026,7 +3026,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
final Set included = rootProps.getIncluded();
if (included != null) {
for (BeanProperty property : propertiesAggregate) {
- if (included.contains(property.getName())) {
+ if (included.contains(property.name())) {
return true;
}
}
@@ -3045,12 +3045,12 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
}
}
- public TableJoin getPrimaryKeyJoin() {
+ public TableJoin primaryKeyJoin() {
return primaryKeyJoin;
}
@Override
- public BeanProperty getIdProperty() {
+ public BeanProperty idProperty() {
return idProperty;
}
@@ -3087,7 +3087,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
public boolean isIdLoaded(EntityBeanIntercept ebi) {
// assume id loaded for IdClass case with idPropertyIndex == -1
- return idPropertyIndex == -1 ? true : ebi.isLoadedProperty(idPropertyIndex);
+ return idPropertyIndex == -1 || ebi.isLoadedProperty(idPropertyIndex);
}
boolean hasIdValue(EntityBean bean) {
@@ -3124,7 +3124,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
*/
public void checkMutableProperties(EntityBeanIntercept ebi) {
for (BeanProperty beanProperty : propertiesMutable) {
- int propertyIndex = beanProperty.getPropertyIndex();
+ int propertyIndex = beanProperty.propertyIndex();
if (ebi.isLoadedProperty(propertyIndex)) {
Object value = beanProperty.getValue(ebi.getOwner());
if (beanProperty.checkMutable(value, ebi.isDirtyProperty(propertyIndex), ebi)) {
@@ -3136,7 +3136,7 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
}
}
- public ConcurrencyMode getConcurrencyMode(EntityBeanIntercept ebi) {
+ public ConcurrencyMode concurrencyMode(EntityBeanIntercept ebi) {
if (!hasVersionProperty(ebi)) {
return ConcurrencyMode.NONE;
} else {
@@ -3176,8 +3176,8 @@ public class BeanDescriptor implements BeanType, STreeType, SpiBeanType {
* provides unique ordering of the rows (so that the paging is predicable).
*/
public void appendOrderById(SpiQuery query) {
- if (idProperty != null && !idProperty.isEmbedded() && !query.order().containsProperty(idProperty.getName())) {
- query.order().asc(idProperty.getName());
+ if (idProperty != null && !idProperty.isEmbedded() && !query.order().containsProperty(idProperty.name())) {
+ query.order().asc(idProperty.name());
}
}
@@ -3287,7 +3287,7 @@ public class BeanDescriptor