Compare commits

...
Author SHA1 Message Date
Rob Bygrave e29e032693 [maven-release-plugin] prepare release ebean-parent-12.11.4 2021-09-09 21:57:43 +12:00
Rob Bygrave 9fc2ec044d #2362 - ENH: Add lock(bean) method as convenience for DB pessimistic locking 2021-09-09 18:18:16 +12:00
Rob Bygrave b739326fca #2361 - Update test-java16 tests - use record style accessors with entity beans 2021-09-09 12:13:34 +12:00
Rob Bygrave 88fd4f5569 #2361 - Update test-java16 test dependencies 2021-09-09 12:04:11 +12:00
Rob Bygrave 4cca3bfa98 #2361 - Tidy test dependencies bump tiles-maven-plugin 2021-09-09 11:44:27 +12:00
Rob Bygrave 8f8d031d91 #2361 - Tidy tests dependencies in ebean-core 2021-09-09 11:39:17 +12:00
Rob Bygrave 7a327cb644 #2361 - Tidy tests only, organise imports 2021-09-09 11:29:05 +12:00
Rob Bygrave 1696caadd4 #2361 - Tidy tests only, move to LoggedSql (ebean-test) 2021-09-09 11:25:04 +12:00
Rob BygraveandGitHub e5dceda4b9 Merge pull request #2361 from ebean-orm/feature/move-tests-to-ebean-test
Refactor move tests from ebean-core to ebean-test
2021-09-09 10:59:42 +12:00
rbygrave eab56d323b Refactor move tests from ebean-core to ebean-test 2021-09-08 22:49:23 +12:00
rbygrave 0b00a14fd3 Refactor tidy tests - remove unused test Main and test MainMemoryLeak 2021-09-08 21:48:53 +12:00
rbygrave c1d57c6b10 Refactor tidy tests 2021-09-08 21:47:52 +12:00
rbygrave 1049435f86 Tidy up ddl-generator BaseTestCase 2021-09-08 17:31:14 +12:00
rbygrave cee879d2f3 #2359 - Rename internal methods - BeanDescriptorManager 2021-09-08 15:34:23 +12:00
rbygrave 93ff2ef2e4 #2359 - Rename internal methods - SpiEbeanServer 2021-09-08 15:25:18 +12:00
rbygrave d389ac680f #2359 - Rename internal methods - BeanDescriptor 2021-09-08 15:17:17 +12:00
rbygrave d582e63c25 #2359 - Rename internal methods - STreeProperty 2021-09-08 14:41:12 +12:00
rbygrave cb9295658c #2359 - Rename internal methods - ElPropertyValue 2021-09-08 14:32:49 +12:00
rbygrave dbc1ab7a57 #2359 - Rename methods and tidy in cache API 2021-09-08 14:25:10 +12:00
rbygrave bb9532f42e #2359 - Rename Transaction.getConnection() method to connection() with deprecation 2021-09-08 14:17:30 +12:00
rbygrave 632f04c76b #2359 - Rename plugin api methods with deprecation - Property 2021-09-08 14:04:31 +12:00
rbygrave bc02eeac57 #2359 - Rename plugin api methods with deprecation - BeanType 2021-09-08 13:13:29 +12:00
rbygrave d6dc147497 #2359 - Rename plugin api methods with deprecation - BeanDocType 2021-09-08 10:59:20 +12:00
rbygrave a15e1ae0a7 #2359 - Rename plugin api methods with deprecation - QueryPlanMetric 2021-09-08 10:53:32 +12:00
rbygrave 8b98335e2e #2359 - Rename plugin api methods with deprecation - BeanDocType 2021-09-08 10:42:51 +12:00
rbygrave 01e07dd2be #2358 - Rename BeanState methods with deprecation 2021-09-08 10:30:18 +12:00
rbygrave 3ac8d6e1d3 #2357 - Modify ddl-generator CurrentModel away from deprecated methods 2021-09-07 21:45:23 +12:00
rbygrave 66143280fa #2357 - Update tests to move away from deprecated methods 2021-09-07 21:44:07 +12:00
rbygrave e95442d8ec #2357 - Update tests to use reference() 2021-09-07 18:13:03 +12:00
rbygrave aafde53b81 #2357 - Update tests to use beanState() 2021-09-07 18:11:51 +12:00
rbygrave 0887480865 #2357 - Update tests to use Database from EbeanServer 2021-09-07 18:10:36 +12:00
rbygrave 4ff8df9538 Tidy tests for ServerConfig -> DatabaseConfig 2021-09-07 17:33:06 +12:00
rbygrave ddb63c1488 Update tests for MariaDB 2021-09-07 16:30:39 +12:00
rbygrave aab2dff49c MySQL Ignore tests that use Hash/Source JSON dirty detection
MySQL JSON type will not preserve ordering of keys. No way to return a consistent JSON result with this type hence Hash/Source do not work
2021-09-07 16:04:07 +12:00
rbygrave d017b2ef39 MySQL Ignore tests that use Hash/Source JSON dirty detection
MySQL JSON type will not preserve ordering of keys. No way to return a consistent JSON result with this type hence Hash/Source do not work
2021-09-07 15:08:28 +12:00
rbygrave 70a967a3a7 Junit5 bump - ebean-core 2021-09-07 13:23:27 +12:00
rbygrave 796edae614 Junit5 bump - tidy ebean-test 2021-09-06 21:37:14 +12:00
rbygrave 50bb7086ac Junit5 bump - tidy ebean-test 2021-09-06 21:01:50 +12:00
rbygrave af8cf9c6c7 Junit5 bump - querybean-generator 2021-09-06 20:57:48 +12:00
rbygrave 6227b081cf Junit5 bump - ebean-test 2021-09-06 20:55:09 +12:00
rbygrave 42645f7236 Junit5 bump - ebean-redis 2021-09-06 20:51:58 +12:00
rbygrave eae8bbac82 Junit5 bump - ebean-querybean 2021-09-06 18:05:11 +12:00
rbygrave 43451c5342 Junit5 bump - ebean-postgis 2021-09-06 17:59:01 +12:00
rbygrave a6f27ca19f Junit5 bump - ebean-externalmapping-xml 2021-09-06 17:53:17 +12:00
rbygrave a7462e86c8 Junit5 bump - ebean-ddl-generator, autotune and api 2021-09-06 17:49:23 +12:00
rbygrave 0ddcfec70d Junit5 bump - ebean-ddl-generator, autotune and api 2021-09-06 17:49:06 +12:00
rbygrave bf70470b9a Junit5 bump - remove parent junit dependency 2021-09-06 16:55:11 +12:00
rbygrave 23c5bd65cf [maven-release-plugin] prepare for next development iteration 2021-09-05 10:54:24 +12:00
1988 changed files with 13133 additions and 13142 deletions
+8 -1
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.3</version>
<version>12.11.4</version>
</parent>
<name>ebean api</name>
@@ -104,6 +104,13 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>junit</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
+131
View File
@@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.4-SNAPSHOT</version>
</parent>
<name>ebean api</name>
<description>ebean api</description>
<artifactId>ebean-api</artifactId>
<dependencies>
<!--
Projects are expected to explicit depend on version
of slf4j that they want to use
-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.30</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-config</artifactId>
<version>1.3</version>
</dependency>
<!--
Class retention Nonnull and Nullable annotations
to assist with IDE auto-completion with Ebean API
-->
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-jsr305</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>persistence-api</artifactId>
<version>2.2.4</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-annotation</artifactId>
<version>7.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-types</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource-api</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<!-- Jackson core used internally by Ebean -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
<optional>true</optional>
</dependency>
<!-- provided scope for JsonNode support -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<optional>true</optional>
</dependency>
<!-- Provided scope so that the H2HistoryTrigger can live in Ebean core
and not require a separate module for it -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.199</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>junit</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<configuration>
<archive>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -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.
* <p>
* Accessing another property will cause lazy loading to occur.
* </p>
*/
Set<String> getLoadedProps();
Set<String> loadedProps();
/**
* Deprecated migrate to loadedProps().
*/
@Deprecated
default Set<String> getLoadedProps() {
return loadedProps();
}
/**
* Return the set of changed properties.
*/
Set<String> getChangedProps();
Set<String> changedProps();
/**
* Deprecated migrate to changedProps().
*/
@Deprecated
default Set<String> getChangedProps() {
return changedProps();
}
/**
* Return a map of the updated properties and their new and old values.
*/
Map<String, ValuePair> getDirtyValues();
Map<String, ValuePair> dirtyValues();
/**
* Deprecated migrate to dirtyValues().
*/
@Deprecated
default Map<String, ValuePair> getDirtyValues() {
return dirtyValues();
}
/**
* Return true if the bean is readOnly.
* <p>
* If a setter is called on a readOnly bean it will throw an exception.
* </p>
*/
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<String, Exception> getLoadErrors();
Map<String, Exception> loadErrors();
/**
* Deprecated migrate to loadErrors().
*/
@Deprecated
default Map<String, Exception> 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();
}
}
+24 -1
View File
@@ -1272,10 +1272,33 @@ public final class DB {
return beanId(bean);
}
/**
* Load and lock the bean using {@code select for update}.
* <p>
* This should be executed inside a transaction.
* <p>
* 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() {
public static ServerCacheManager cacheManager() {
return getDefault().cacheManager();
}
@@ -1714,6 +1714,20 @@ public interface Database {
*/
<T> Set<String> validateQuery(Query<T> query);
/**
* Load and lock the bean using {@code select for update}.
* <p>
* 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}.
* <p>
* 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.
*/
@@ -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.
@@ -13,9 +13,7 @@ import java.util.Set;
public class QueryCacheEntry {
private final Object value;
private final Set<String> dependentTables;
private final long timestamp;
/**
@@ -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;
@@ -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.
@@ -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()) {
@@ -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.
@@ -16,11 +16,27 @@ public interface BeanDocType<T> {
/**
* 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<T> {
/**
* 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);
/**
@@ -22,24 +22,56 @@ public interface BeanType<T> {
* 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<T> getBeanType();
Class<T> type();
/**
* Deprecated migrate to type().
*/
@Deprecated
default Class<T> 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<T> {
/**
* 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<T> {
* This can return a property or nested property path.
* </p>
*/
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<T> {
/**
* 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,10 +198,18 @@ public interface BeanType<T> {
/**
* Return the bean id. This is the same as getBeanId() but without the generic type.
*/
Object beanId(Object bean);
Object id(Object bean);
/**
* Deprecated migrate to beanId()
* Deprecated migrate to id()
*/
@Deprecated
default Object beanId(Object bean) {
return id(bean);
}
/**
* Deprecated migrate to id()
*/
@Deprecated
Object getBeanId(T bean);
@@ -129,32 +217,80 @@ public interface BeanType<T> {
/**
* 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.
@@ -168,12 +304,28 @@ public interface BeanType<T> {
* for the document store.
* </p>
*/
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.\
@@ -204,12 +356,28 @@ public interface BeanType<T> {
/**
* Returns all direct children of this beantype
*/
List<BeanType<?>> getInheritanceChildren();
List<BeanType<?>> inheritanceChildren();
/**
* Returns the parent in inheritance hiearchy
* Deprecated migrate to inheritanceChildren()
*/
BeanType<?> getInheritanceParent();
@Deprecated
default List<BeanType<?>> 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
@@ -219,7 +387,15 @@ public interface BeanType<T> {
/**
* 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.
@@ -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.
* </p>
*/
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();
}
}
@@ -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.
@@ -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;
+7 -7
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.3</version>
<version>12.11.4</version>
</parent>
<!-- <parent>-->
<!-- <groupId>org.avaje</groupId>-->
@@ -14,7 +14,7 @@
<scm>
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
<tag>ebean-parent-12.11.3</tag>
<tag>ebean-parent-12.11.4</tag>
</scm>
<name>ebean autotune</name>
@@ -26,7 +26,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
<scope>provided</scope>
</dependency>
@@ -46,9 +46,9 @@
</dependency>
<dependency>
<groupId>org.avaje.composite</groupId>
<groupId>io.avaje</groupId>
<artifactId>junit</artifactId>
<version>1.1</version>
<version>1.0</version>
<scope>test</scope>
</dependency>
@@ -59,12 +59,12 @@
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.19</version>
<version>2.24</version>
<extensions>true</extensions>
<configuration>
<tiles>
<!-- other tiles ... -->
<tile>io.ebean.tile:enhancement:12.6.0</tile>
<tile>io.ebean.tile:enhancement:12.11.3</tile>
</tiles>
</configuration>
</plugin>
+85
View File
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.4-SNAPSHOT</version>
</parent>
<!-- <parent>-->
<!-- <groupId>org.avaje</groupId>-->
<!-- <artifactId>java8-oss</artifactId>-->
<!-- <version>2.2</version>-->
<!-- </parent>-->
<scm>
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
<tag>ebean-parent-12.8.0</tag>
</scm>
<name>ebean autotune</name>
<description>ebean automatic query tuning module</description>
<artifactId>ebean-autotune</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>12.11.4-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- needed for java 11+ -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>junit</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.24</version>
<extensions>true</extensions>
<configuration>
<tiles>
<!-- other tiles ... -->
<tile>io.ebean.tile:enhancement:12.11.3</tile>
</tiles>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<configuration>
<archive>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -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);
}
@@ -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();
@@ -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;
@@ -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;
@@ -11,6 +11,6 @@ public class BaseTestCase {
}
protected <T> BeanDescriptor<T> getBeanDescriptor(Class<T> cls) {
return spiEbeanServer().getBeanDescriptor(cls);
return spiEbeanServer().descriptor(cls);
}
}
+15 -15
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.3</version>
<version>12.11.4</version>
</parent>
<name>ebean bom</name>
@@ -71,88 +71,88 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-xml</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-autotune</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>kotlin-querybean-generator</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-redis</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
</dependency>
</dependencies>
+162
View File
@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.4-SNAPSHOT</version>
</parent>
<name>ebean bom</name>
<description>ebean bill of materials pom</description>
<artifactId>ebean-bom</artifactId>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<!-- dependencies external to this ebean.git build -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-runner</artifactId>
<version>${ebean-ddl-runner.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration-auto</artifactId>
<version>${ebean-migration-auto.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource-api</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-agent</artifactId>
<version>${ebean-agent.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-maven-plugin</artifactId>
<version>${ebean-maven-plugin.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test-docker</artifactId>
<version>${ebean-test-docker.version}</version>
</dependency>
<!-- modules -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean</artifactId>
<version>12.11.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>12.11.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>12.11.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>12.11.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>12.11.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>12.11.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-xml</artifactId>
<version>12.11.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-autotune</artifactId>
<version>12.11.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>12.11.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>12.11.4-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>kotlin-querybean-generator</artifactId>
<version>12.11.4-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>12.11.4-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis</artifactId>
<version>12.11.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-redis</artifactId>
<version>12.11.4-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
+2 -2
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.3</version>
<version>12.11.4</version>
</parent>
<artifactId>ebean-core-type</artifactId>
@@ -16,7 +16,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
</dependency>
<dependency>
+31
View File
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.4-SNAPSHOT</version>
</parent>
<artifactId>ebean-core-type</artifactId>
<name>ebean core type</name>
<description>ebean scalar types api</description>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>12.11.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
<optional>true</optional>
</dependency>
</dependencies>
</project>
+7 -136
View File
@@ -3,7 +3,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.3</version>
<version>12.11.4</version>
</parent>
<artifactId>ebean-core</artifactId>
@@ -15,23 +15,9 @@
<scm>
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
<tag>ebean-parent-12.11.3</tag>
<tag>ebean-parent-12.11.4</tag>
</scm>
<profiles>
<profile>
<id>db2</id>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.ibm.db2/jcc -->
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>jcc</artifactId>
<version>11.5.5.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<dependencies>
<dependency>
@@ -52,45 +38,22 @@
<version>1.1</version>
</dependency>
<!-- keep testing in core using ebean-ddl-generator & ebean-migration -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>12.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>12.11.0</version>
<scope>test</scope>
</dependency>
<!-- test scope for supporting ebean-ddl-generator -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>12.11.3</version>
<version>12.11.4</version>
</dependency>
<dependency>
@@ -186,107 +149,15 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.nuodb.jdbc</groupId>
<artifactId>nuodb-jdbc</artifactId>
<version>20.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<artifactId>ojdbc10</artifactId>
<version>19.3.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test-docker</artifactId>
<version>4.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.15.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.3.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.2.2.jre8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.17</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sap.cloud.db.jdbc</groupId>
<artifactId>ngdbc</artifactId>
<version>2.3.48</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.avaje.composite</groupId>
<artifactId>junit</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>mod-uuid</artifactId>
<version>1.1</version>
<artifactId>junit</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
+246
View File
@@ -0,0 +1,246 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.4-SNAPSHOT</version>
</parent>
<artifactId>ebean-core</artifactId>
<packaging>jar</packaging>
<name>ebean core</name>
<description>ebean core module</description>
<url>https://ebean.io/</url>
<scm>
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
<tag>ebean-parent-12.8.0</tag>
</scm>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-runner</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>classpath-scanner</artifactId>
<version>6.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration-auto</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>12.11.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>12.11.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>12.11.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.8-1</version>
</dependency>
<!--
Class retention Nonnull and Nullable annotations
to assist with IDE auto-completion with Ebean API
-->
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-jsr305</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<!-- Provided scope so that the H2HistoryTrigger can live in Ebean core
and not require a separate module for it -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.199</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
<optional>true</optional>
</dependency>
<!-- validation annotations Size etc -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.7</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
<optional>true</optional>
</dependency>
<!-- Jackson core used internally by Ebean -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<optional>true</optional>
</dependency>
<!-- Provided scope for Postgres JSON/JSONB support -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.20</version>
<optional>true</optional>
</dependency>
<!-- Test scope -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>junit</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.ebean</groupId>
<artifactId>ebean-maven-plugin</artifactId>
<version>${ebean-maven-plugin.version}</version>
<executions>
<execution>
<id>test</id>
<phase>process-test-classes</phase>
<configuration>
<transformArgs>debug=0</transformArgs>
</configuration>
<goals>
<goal>testEnhance</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<trimStackTrace>false</trimStackTrace>
<failIfNoTests>false</failIfNoTests>
<includes>
<include>**/Test*.java</include>
<include>**/*Test.java</include>
<include>**/*Tests.java</include>
</includes>
<systemProperties>
<property>
<!-- transfer datasource.default parameter -->
<name>datasource.default</name>
<value>${datasource.default}</value>
</property>
<property>
<!-- transfer dbClockDelta parameter -->
<name>dbClockDelta</name>
<value>${dbClockDelta}</value>
</property>
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<configuration>
<archive>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<doctitle>Ebean 12</doctitle>
<overview>src/main/java/io/ebean/overview.html</overview>
<excludePackageNames>io.ebeaninternal.*:io.ebeanservice:io.ebean.common:io.ebean.bean:io.ebean.service:io.ebean.metric:io.ebean.util:io.ebean.config.properties:io.ebean.config.dbplatform</excludePackageNames>
<linksource>true</linksource>
<overview>src/main/java/com/avaje/ebean/overview.html</overview>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -48,7 +48,7 @@ public final class LoadBeanRequest extends LoadRequest {
@Override
public Class<?> beanType() {
return loadBuffer.descriptor().getBeanType();
return loadBuffer.descriptor().type();
}
public String description() {
@@ -108,7 +108,7 @@ public final class LoadBeanRequest extends LoadRequest {
BeanDescriptor<?> desc = loadBuffer.descriptor();
// collect Ids and maybe load bean cache
for (Object bean : list) {
loadedIds.add(desc.beanId(bean));
loadedIds.add(desc.id(bean));
}
if (loadCache) {
desc.cacheBeanPutAll(list);
@@ -49,7 +49,7 @@ public final class LoadManyRequest extends LoadRequest {
@Override
public Class<?> beanType() {
return loadContext.getBeanDescriptor().getBeanType();
return loadContext.getBeanDescriptor().type();
}
public String description() {
@@ -60,10 +60,10 @@ public final class LoadManyRequest extends LoadRequest {
List<Object> idList = new ArrayList<>();
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;
@@ -76,11 +76,11 @@ public final class LoadManyRequest extends LoadRequest {
public SpiQuery<?> createQuery(SpiEbeanServer server) {
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
@@ -99,7 +99,7 @@ public final class LoadManyRequest extends LoadRequest {
loadContext.configureQuery(query);
if (onlyIds) {
// lazy loading invoked via clear() and removeAll()
query.select(many.getTargetIdProperty());
query.select(many.targetIdProperty());
}
return query;
}
@@ -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);
}
@@ -8,6 +8,6 @@ public interface SpiBeanTypeManager {
/**
* Return the bean type for the given entity class.
*/
SpiBeanType getBeanType(Class<?> entityType);
SpiBeanType beanType(Class<?> entityType);
}
@@ -63,7 +63,7 @@ public interface SpiEbeanServer extends SpiServer, ExtendedServer, EbeanServer,
/**
* Return the PersistenceContextScope to use defined at query or server level.
*/
PersistenceContextScope getPersistenceContextScope(SpiQuery<?> query);
PersistenceContextScope persistenceContextScope(SpiQuery<?> query);
/**
* Clear the query execution statistics.
@@ -73,32 +73,32 @@ public interface SpiEbeanServer extends SpiServer, ExtendedServer, EbeanServer,
/**
* Return the transaction manager.
*/
SpiTransactionManager getTransactionManager();
SpiTransactionManager transactionManager();
/**
* Return all the descriptors.
*/
List<BeanDescriptor<?>> getBeanDescriptors();
List<BeanDescriptor<?>> descriptors();
/**
* Return the BeanDescriptor for a given type of bean.
*/
<T> BeanDescriptor<T> getBeanDescriptor(Class<T> type);
<T> BeanDescriptor<T> descriptor(Class<T> 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<BeanDescriptor<?>> getBeanDescriptors(String tableName);
List<BeanDescriptor<?>> descriptors(String tableName);
/**
* Process committed changes from another framework.
@@ -170,7 +170,7 @@ public interface SpiEbeanServer extends SpiServer, ExtendedServer, EbeanServer,
/**
* 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
@@ -181,18 +181,18 @@ public interface SpiEbeanServer extends SpiServer, ExtendedServer, EbeanServer,
/**
* 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.
@@ -318,8 +318,8 @@ public abstract class SpiTransactionProxy implements SpiTransaction {
}
@Override
public Connection getConnection() {
return transaction.getConnection();
public Connection connection() {
return transaction.connection();
}
@Override
@@ -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 <T> void addBeanUpdate(BeanDescriptor<T> desc, String key, Map<String, Object> changes, boolean updateNaturalKey, long version) {
touchedTables.add(desc.getBaseTable());
touchedTables.add(desc.baseTable());
entries.add(new CacheChangeBeanUpdate(desc, key, changes, updateNaturalKey, version));
}
@@ -15,33 +15,33 @@ public final class CachedBeanDataFromBean {
EntityBeanIntercept ebi = bean._ebean_getIntercept();
Map<String, Object> 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);
@@ -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);
}
}
@@ -65,17 +65,17 @@ public final class DefaultServerCacheManager implements SpiCacheManager {
List<String> 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());
}
}
}
@@ -122,6 +122,6 @@ public abstract class BeanRequest {
* Return the DataTimeZone to use.
*/
public DataTimeZone dataTimeZone() {
return server.getDataTimeZone();
return server.dataTimeZone();
}
}
@@ -54,8 +54,8 @@ final class DefaultBeanLoader {
private void loadManyInternal(EntityBean parentBean, String propertyName, Transaction t, boolean refresh, boolean onlyIds) {
EntityBeanIntercept ebi = parentBean._ebean_getIntercept();
PersistenceContext pc = ebi.getPersistenceContext();
BeanDescriptor<?> parentDesc = server.getBeanDescriptor(parentBean.getClass());
BeanPropertyAssocMany<?> many = (BeanPropertyAssocMany<?>) parentDesc.getBeanProperty(propertyName);
BeanDescriptor<?> parentDesc = server.descriptor(parentBean.getClass());
BeanPropertyAssocMany<?> many = (BeanPropertyAssocMany<?>) parentDesc.beanProperty(propertyName);
BeanCollection<?> beanCollection = null;
ExpressionList<?> filterMany = null;
@@ -81,7 +81,7 @@ final class DefaultBeanLoader {
}
}
SpiQuery<?> query = server.createQuery(parentDesc.getBeanType());
SpiQuery<?> query = server.createQuery(parentDesc.type());
if (refresh) {
// populate a new collection
BeanCollection<?> emptyCollection = many.createEmpty(parentBean);
@@ -91,20 +91,20 @@ final class DefaultBeanLoader {
query.setLoadDescription("+lazy", null);
}
query.select(parentDesc.getIdBinder().getIdProperty());
query.select(parentDesc.idBinder().getIdProperty());
if (onlyIds) {
query.fetch(many.getName(), many.getTargetIdProperty());
query.fetch(many.name(), many.targetIdProperty());
} else {
query.fetch(many.getName());
query.fetch(many.name());
}
if (filterMany != null) {
query.setFilterMany(many.getName(), filterMany);
query.setFilterMany(many.name(), filterMany);
}
query.where().idEq(parentId);
query.setBeanCacheMode(CacheMode.OFF);
query.setMode(Mode.LAZYLOAD_MANY);
query.setLazyLoadManyPath(many.getName());
query.setLazyLoadManyPath(many.name());
query.setPersistenceContext(pc);
if (ebi.isReadOnly()) {
query.setReadOnly(true);
@@ -176,8 +176,8 @@ final class DefaultBeanLoader {
pc = null;
}
BeanDescriptor<?> desc = server.getBeanDescriptor(bean.getClass());
if (EntityType.EMBEDDED == desc.getEntityType()) {
BeanDescriptor<?> desc = server.descriptor(bean.getClass());
if (EntityType.EMBEDDED == desc.entityType()) {
// lazy loading on an embedded bean property
EntityBean embeddedOwner = (EntityBean) ebi.getEmbeddedOwner();
refreshBeanInternal(embeddedOwner, mode, ebi.getEmbeddedOwnerIndex());
@@ -203,7 +203,7 @@ final class DefaultBeanLoader {
}
}
SpiQuery<?> query = server.createQuery(desc.getBeanType());
SpiQuery<?> query = server.createQuery(desc.type());
query.setLazyLoadProperty(ebi.getLazyLoadProperty());
if (draft) {
query.asDraft();
@@ -236,7 +236,7 @@ final class DefaultBeanLoader {
Object dbBean = query.findOne();
if (dbBean == null) {
throw new EntityNotFoundException("Bean not found during lazy load or refresh." + " id[" + id + "] type[" + desc.getBeanType() + "]");
throw new EntityNotFoundException("Bean not found during lazy load or refresh." + " id[" + id + "] type[" + desc.type() + "]");
}
desc.resetManyProperties(dbBean);
}
@@ -45,17 +45,17 @@ public final class DefaultBeanState implements BeanState {
}
@Override
public Set<String> getLoadedProps() {
public Set<String> loadedProps() {
return intercept.getLoadedPropertyNames();
}
@Override
public Set<String> getChangedProps() {
public Set<String> changedProps() {
return intercept.getDirtyPropertyNames();
}
@Override
public Map<String, ValuePair> getDirtyValues() {
public Map<String, ValuePair> dirtyValues() {
return intercept.getDirtyValues();
}
@@ -90,12 +90,12 @@ public final class DefaultBeanState implements BeanState {
}
@Override
public Map<String, Exception> getLoadErrors() {
public Map<String, Exception> loadErrors() {
return intercept.getLoadErrors();
}
@Override
public int getSortOrder() {
public int sortOrder() {
return intercept.getSortOrder();
}
}
@@ -129,16 +129,7 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.time.Clock;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.Spliterator;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;
@@ -295,7 +286,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
}
@Override
public int getLazyLoadBatchSize() {
public int lazyLoadBatchSize() {
return lazyLoadBatchSize;
}
@@ -320,7 +311,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
}
@Override
public DataTimeZone getDataTimeZone() {
public DataTimeZone dataTimeZone() {
return dataTimeZone;
}
@@ -365,12 +356,12 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
}
@Override
public ReadAuditPrepare getReadAuditPrepare() {
public ReadAuditPrepare readAuditPrepare() {
return readAuditPrepare;
}
@Override
public ReadAuditLogger getReadAuditLogger() {
public ReadAuditLogger readAuditLogger() {
return readAuditLogger;
}
@@ -595,7 +586,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
if (a == null) {
return null;
}
BeanDescriptor<?> desc = getBeanDescriptor(a.getClass());
BeanDescriptor<?> desc = descriptor(a.getClass());
return DiffHelp.diff(a, b, desc);
}
@@ -628,7 +619,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
public void truncate(Class<?>... types) {
List<String> tableNames = new ArrayList<>();
for (Class<?> type : types) {
tableNames.add(getBeanDescriptor(type).getBaseTable());
tableNames.add(descriptor(type).baseTable());
}
truncate(tableNames.toArray(new String[0]));
}
@@ -659,7 +650,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
*/
@Override
public void clearQueryStatistics() {
for (BeanDescriptor<?> desc : getBeanDescriptors()) {
for (BeanDescriptor<?> desc : descriptors()) {
desc.clearQueryStatistics();
}
}
@@ -674,7 +665,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
*/
@Override
public <T> T createEntityBean(Class<T> type) {
return getBeanDescriptor(type).createBean();
return descriptor(type).createBean();
}
/**
@@ -691,7 +682,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
if (id == null) {
throw new NullPointerException("The id is null");
}
BeanDescriptor desc = getBeanDescriptor(type);
BeanDescriptor desc = descriptor(type);
id = desc.convertId(id);
PersistenceContext pc = null;
SpiTransaction t = transactionManager.getActive();
@@ -703,17 +694,17 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
}
}
InheritInfo inheritInfo = desc.getInheritInfo();
InheritInfo inheritInfo = desc.inheritInfo();
if (inheritInfo == null || inheritInfo.isConcrete()) {
return (T) desc.contextRef(pc, null, false, id);
}
BeanProperty idProp = desc.getIdProperty();
BeanProperty idProp = desc.idProperty();
if (idProp == null) {
throw new PersistenceException("No ID properties for this type? " + desc);
}
// we actually need to do a query because we don't know the type without the discriminator
// value, just select the id property and discriminator column (auto added)
return find(type).select(idProp.getName()).setId(id).findOne();
return find(type).select(idProp.name()).setId(id).findOne();
}
@Override
@@ -852,7 +843,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
@Override
public Object nextId(Class<?> beanType) {
BeanDescriptor<?> desc = getBeanDescriptor(beanType);
BeanDescriptor<?> desc = descriptor(beanType);
return desc.nextId(null);
}
@@ -871,7 +862,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
}
// use first bean in the list as the correct type
Class<T> beanType = (Class<T>) list.get(0).getClass();
BeanDescriptor<T> beanDescriptor = getBeanDescriptor(beanType);
BeanDescriptor<T> beanDescriptor = descriptor(beanType);
if (beanDescriptor == null) {
throw new PersistenceException("BeanDescriptor not found, is [" + beanType + "] an entity bean?");
}
@@ -880,7 +871,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
@Override
public <T> Set<String> validateQuery(Query<T> query) {
BeanDescriptor<T> beanDescriptor = getBeanDescriptor(query.getBeanType());
BeanDescriptor<T> beanDescriptor = descriptor(query.getBeanType());
if (beanDescriptor == null) {
throw new PersistenceException("BeanDescriptor not found, is [" + query.getBeanType() + "] an entity bean?");
}
@@ -889,7 +880,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
@Override
public <T> Filter<T> filter(Class<T> beanType) {
BeanDescriptor<T> desc = getBeanDescriptor(beanType);
BeanDescriptor<T> desc = descriptor(beanType);
if (desc == null) {
String m = beanType.getName() + " is NOT an Entity Bean registered with this server?";
throw new PersistenceException(m);
@@ -899,7 +890,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
@Override
public <T> CsvReader<T> createCsvReader(Class<T> beanType) {
BeanDescriptor<T> descriptor = getBeanDescriptor(beanType);
BeanDescriptor<T> descriptor = descriptor(beanType);
if (descriptor == null) {
throw new NullPointerException("BeanDescriptor for " + beanType.getName() + " not found");
}
@@ -923,13 +914,27 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
@Override
public void merge(Object bean, MergeOptions options, Transaction transaction) {
BeanDescriptor<?> desc = getBeanDescriptor(bean.getClass());
BeanDescriptor<?> desc = descriptor(bean.getClass());
if (desc == null) {
throw new PersistenceException(bean.getClass().getName() + " is NOT an Entity Bean registered with this server?");
}
executeInTrans((txn) -> persister.merge(desc, checkEntityBean(bean), options, txn), transaction);
}
@Override
public void lock(Object bean) {
BeanDescriptor<?> desc = descriptor(bean.getClass());
if (desc == null) {
throw new PersistenceException(bean.getClass() + " is NOT an Entity Bean registered with this server?");
}
Object id = desc.id(bean);
Objects.requireNonNull(id, "Bean missing an @Id value which is required to lock");
new DefaultOrmQuery<>(desc, this, expressionFactory)
.setId(id)
.withLock(Query.LockType.DEFAULT, Query.LockWait.NOWAIT)
.findOne();
}
@Override
public <T> Query<T> find(Class<T> beanType) {
return createQuery(beanType);
@@ -937,7 +942,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
@Override
public <T> Query<T> findNative(Class<T> beanType, String nativeSql) {
BeanDescriptor<T> desc = getBeanDescriptor(beanType);
BeanDescriptor<T> desc = descriptor(beanType);
if (desc == null) {
throw new PersistenceException(beanType.getName() + " is NOT an Entity Bean registered with this server?");
}
@@ -948,15 +953,15 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
@Override
public <T> Query<T> createNamedQuery(Class<T> beanType, String namedQuery) {
BeanDescriptor<T> desc = getBeanDescriptor(beanType);
BeanDescriptor<T> desc = descriptor(beanType);
if (desc == null) {
throw new PersistenceException(beanType.getName() + " is NOT an Entity Bean registered with this server?");
}
String named = desc.getNamedQuery(namedQuery);
String named = desc.namedQuery(namedQuery);
if (named != null) {
return createQuery(beanType, named);
}
SpiRawSql rawSql = desc.getNamedRawSql(namedQuery);
SpiRawSql rawSql = desc.namedRawSql(namedQuery);
if (rawSql != null) {
DefaultOrmQuery<T> query = createQuery(beanType);
query.setRawSql(rawSql);
@@ -974,7 +979,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
@Override
public <T> DefaultOrmQuery<T> createQuery(Class<T> beanType) {
BeanDescriptor<T> desc = getBeanDescriptor(beanType);
BeanDescriptor<T> desc = descriptor(beanType);
if (desc == null) {
throw new PersistenceException(beanType.getName() + " is NOT an Entity Bean registered with this server?");
}
@@ -983,12 +988,12 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
@Override
public <T> Update<T> createUpdate(Class<T> beanType, String ormUpdate) {
BeanDescriptor<?> desc = getBeanDescriptor(beanType);
BeanDescriptor<?> desc = descriptor(beanType);
if (desc == null) {
String m = beanType.getName() + " is NOT an Entity Bean registered with this server?";
throw new PersistenceException(m);
}
return new DefaultOrmUpdate<>(beanType, this, desc.getBaseTable(), ormUpdate);
return new DefaultOrmUpdate<>(beanType, this, desc.baseTable(), ormUpdate);
}
@Override
@@ -1134,14 +1139,14 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
* Return true if transactions PersistenceContext should be used.
*/
private <T> boolean useTransactionPersistenceContext(SpiQuery<T> query) {
return PersistenceContextScope.TRANSACTION == getPersistenceContextScope(query);
return PersistenceContextScope.TRANSACTION == persistenceContextScope(query);
}
/**
* Return the PersistenceContextScope to use defined at query or server level.
*/
@Override
public PersistenceContextScope getPersistenceContextScope(SpiQuery<?> query) {
public PersistenceContextScope persistenceContextScope(SpiQuery<?> query) {
PersistenceContextScope scope = query.getPersistenceContextScope();
return (scope != null) ? scope : defaultPersistenceContextScope;
}
@@ -1391,7 +1396,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
// FutureList query always run in it's own persistence content
spiQuery.setPersistenceContext(new DefaultPersistenceContext());
if (!spiQuery.isDisableReadAudit()) {
BeanDescriptor<T> desc = beanDescriptorManager.getBeanDescriptor(spiQuery.getBeanType());
BeanDescriptor<T> desc = beanDescriptorManager.descriptor(spiQuery.getBeanType());
desc.readAuditFutureList(spiQuery);
}
// Create a new transaction solely to execute the findList() at some future time
@@ -2048,26 +2053,26 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
* Return all the BeanDescriptors.
*/
@Override
public List<BeanDescriptor<?>> getBeanDescriptors() {
return beanDescriptorManager.getBeanDescriptorList();
public List<BeanDescriptor<?>> descriptors() {
return beanDescriptorManager.descriptorList();
}
/**
* Return the transaction manager.
*/
@Override
public SpiTransactionManager getTransactionManager() {
public SpiTransactionManager transactionManager() {
return transactionManager;
}
public void register(BeanPersistController controller) {
for (BeanDescriptor<?> desc : beanDescriptorManager.getBeanDescriptorList()) {
for (BeanDescriptor<?> desc : beanDescriptorManager.descriptorList()) {
desc.register(controller);
}
}
public void deregister(BeanPersistController c) {
for (BeanDescriptor<?> desc : beanDescriptorManager.getBeanDescriptorList()) {
for (BeanDescriptor<?> desc : beanDescriptorManager.descriptorList()) {
desc.deregister(c);
}
}
@@ -2075,13 +2080,13 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
@Override
public boolean isSupportedType(java.lang.reflect.Type genericType) {
TypeInfo typeInfo = ParamTypeHelper.getTypeInfo(genericType);
return typeInfo != null && getBeanDescriptor(typeInfo.getBeanType()) != null;
return typeInfo != null && descriptor(typeInfo.getBeanType()) != null;
}
@Override
public Object beanId(Object bean, Object id) {
EntityBean eb = checkEntityBean(bean);
BeanDescriptor<?> desc = getBeanDescriptor(bean.getClass());
BeanDescriptor<?> desc = descriptor(bean.getClass());
if (desc == null) {
throw new PersistenceException(bean.getClass().getName() + " is NOT an Entity Bean registered with this server?");
}
@@ -2091,7 +2096,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
@Override
public Object beanId(Object bean) {
EntityBean eb = checkEntityBean(bean);
BeanDescriptor<?> desc = getBeanDescriptor(bean.getClass());
BeanDescriptor<?> desc = descriptor(bean.getClass());
if (desc == null) {
throw new PersistenceException(bean.getClass().getName() + " is NOT an Entity Bean registered with this server?");
}
@@ -2102,16 +2107,16 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
* Return the BeanDescriptor for a given type of bean.
*/
@Override
public <T> BeanDescriptor<T> getBeanDescriptor(Class<T> beanClass) {
return beanDescriptorManager.getBeanDescriptor(beanClass);
public <T> BeanDescriptor<T> descriptor(Class<T> beanClass) {
return beanDescriptorManager.descriptor(beanClass);
}
/**
* Return the BeanDescriptor's for a given table name.
*/
@Override
public List<BeanDescriptor<?>> getBeanDescriptors(String tableName) {
return beanDescriptorManager.getBeanDescriptors(tableName);
public List<BeanDescriptor<?>> descriptors(String tableName) {
return beanDescriptorManager.descriptors(tableName);
}
/**
@@ -2119,7 +2124,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
*/
@Override
public List<? extends BeanType<?>> beanTypes() {
return getBeanDescriptors();
return descriptors();
}
/**
@@ -2127,17 +2132,17 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
*/
@Override
public List<? extends BeanType<?>> beanTypes(String tableName) {
return beanDescriptorManager.getBeanTypes(tableName);
return beanDescriptorManager.beanTypes(tableName);
}
@Override
public BeanType<?> beanTypeForQueueId(String queueId) {
return getBeanDescriptorByQueueId(queueId);
return descriptorByQueueId(queueId);
}
@Override
public BeanDescriptor<?> getBeanDescriptorByQueueId(String queueId) {
return beanDescriptorManager.getBeanDescriptorByQueueId(queueId);
public BeanDescriptor<?> descriptorByQueueId(String queueId) {
return beanDescriptorManager.descriptorByQueueId(queueId);
}
/**
@@ -2145,15 +2150,15 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
*/
@Override
public <T> BeanType<T> beanType(Class<T> beanType) {
return getBeanDescriptor(beanType);
return descriptor(beanType);
}
/**
* Return the BeanDescriptor using its class name.
*/
@Override
public BeanDescriptor<?> getBeanDescriptorById(String beanClassName) {
return beanDescriptorManager.getBeanDescriptorByClassName(beanClassName);
public BeanDescriptor<?> descriptorById(String beanClassName) {
return beanDescriptorManager.descriptorByClassName(beanClassName);
}
/**
@@ -2278,13 +2283,13 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
@Override
public Set<Property> checkUniqueness(Object bean, Transaction transaction) {
EntityBean entityBean = checkEntityBean(bean);
BeanDescriptor<?> beanDesc = getBeanDescriptor(entityBean.getClass());
BeanProperty idProperty = beanDesc.getIdProperty();
BeanDescriptor<?> beanDesc = descriptor(entityBean.getClass());
BeanProperty idProperty = beanDesc.idProperty();
// if the ID of the Property is null we are unable to check uniqueness
if (idProperty == null) {
return Collections.emptySet();
}
Object id = idProperty.getVal(entityBean);
Object id = idProperty.value(entityBean);
if (entityBean._ebean_getIntercept().isNew() && id != null) {
// Primary Key is changeable only on new models - so skip check if we are not new
Query<?> query = new DefaultOrmQuery<>(beanDesc, this, expressionFactory);
@@ -2293,7 +2298,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
return Collections.singleton(idProperty);
}
}
for (BeanProperty[] props : beanDesc.getUniqueProps()) {
for (BeanProperty[] props : beanDesc.uniqueProps()) {
Set<Property> ret = checkUniqueness(entityBean, beanDesc, props, transaction);
if (ret != null) {
return ret;
@@ -2306,19 +2311,19 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
* Returns a set of properties if saving the bean will violate the unique constraints (defined by given properties).
*/
private Set<Property> checkUniqueness(EntityBean entityBean, BeanDescriptor<?> beanDesc, BeanProperty[] props, Transaction transaction) {
BeanProperty idProperty = beanDesc.getIdProperty();
BeanProperty idProperty = beanDesc.idProperty();
Query<?> query = new DefaultOrmQuery<>(beanDesc, this, expressionFactory);
ExpressionList<?> exprList = query.where();
if (!entityBean._ebean_getIntercept().isNew()) {
// if model is not new, exclude ourself.
exprList.ne(idProperty.getName(), idProperty.getVal(entityBean));
exprList.ne(idProperty.name(), idProperty.value(entityBean));
}
for (Property prop : props) {
Object value = prop.getVal(entityBean);
Object value = prop.value(entityBean);
if (value == null) {
return null;
}
exprList.eq(prop.getName(), value);
exprList.eq(prop.name(), value);
}
if (findCount(query, transaction) > 0) {
Set<Property> ret = new LinkedHashSet<>();
@@ -66,7 +66,7 @@ public final class DtoQueryRequest<T> extends AbstractSqlQueryRequest {
@Override
protected void setResultSet(ResultSet resultSet, Object queryPlanKey) throws SQLException {
this.resultSet = resultSet;
this.dataReader = new RsetDataReader(server.getDataTimeZone(), resultSet);
this.dataReader = new RsetDataReader(server.dataTimeZone(), resultSet);
obtainPlan(queryPlanKey);
}
@@ -175,7 +175,7 @@ public final class InternalConfiguration {
this.dtoBeanManager = new DtoBeanManager(typeManager, xmlMap.readDtoMapping());
this.beanDescriptorManager = new BeanDescriptorManager(this);
Map<String, String> asOfTableMapping = beanDescriptorManager.deploy(xmlMap.xmlDeployment());
Map<String, String> draftTableMap = beanDescriptorManager.getDraftTableMap();
Map<String, String> draftTableMap = beanDescriptorManager.draftTableMap();
beanDescriptorManager.scheduleBackgroundTrim();
this.dataTimeZone = initDataTimeZone();
this.binder = getBinder(typeManager, databasePlatform, dataTimeZone);
@@ -78,7 +78,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
public OrmQueryRequest(SpiEbeanServer server, OrmQueryEngine queryEngine, SpiQuery<T> query, SpiTransaction t) {
super(server, t);
this.beanDescriptor = query.getBeanDescriptor();
this.finder = beanDescriptor.getBeanFinder();
this.finder = beanDescriptor.beanFinder();
this.queryEngine = queryEngine;
this.query = query;
this.readOnly = query.isReadOnly();
@@ -190,7 +190,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
* Run BeanQueryAdapter preQuery() if needed.
*/
private void adapterPreQuery() {
BeanQueryAdapter queryAdapter = beanDescriptor.getQueryAdapter();
BeanQueryAdapter queryAdapter = beanDescriptor.queryAdapter();
if (queryAdapter != null) {
queryAdapter.preQuery(this);
}
@@ -325,7 +325,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
if (ctx != null) return ctx;
// determine the scope (from the query and then server)
PersistenceContextScope scope = server.getPersistenceContextScope(query);
PersistenceContextScope scope = server.persistenceContextScope(query);
if (scope == PersistenceContextScope.QUERY || t == null) {
return new DefaultPersistenceContext();
}
@@ -468,9 +468,9 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
public <K> Map<K, T> findMap() {
String mapKey = query.getMapKey();
if (mapKey == null) {
BeanProperty idProp = beanDescriptor.getIdProperty();
BeanProperty idProp = beanDescriptor.idProperty();
if (idProp != null) {
query.setMapKey(idProp.getName());
query.setMapKey(idProp.name());
} else {
throw new PersistenceException("No mapKey specified for query");
}
@@ -499,7 +499,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
* Determine and return the ToMany property that is included in the query.
*/
public BeanPropertyAssocMany<?> determineMany() {
manyProperty = beanDescriptor.getManyProperty(query);
manyProperty = beanDescriptor.manyProperty(query);
return manyProperty;
}
@@ -515,7 +515,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
* query plan for this query exists.
*/
public CQueryPlan queryPlan() {
return beanDescriptor.getQueryPlan(queryPlanKey);
return beanDescriptor.queryPlan(queryPlanKey);
}
/**
@@ -533,7 +533,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
* Put the QueryPlan into the cache.
*/
public void putQueryPlan(CQueryPlan queryPlan) {
beanDescriptor.putQueryPlan(queryPlanKey, queryPlan);
beanDescriptor.queryPlan(queryPlanKey, queryPlan);
}
@Override
@@ -617,7 +617,7 @@ public final class OrmQueryRequest<T> 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());
}
@@ -684,7 +684,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
Collection<T> actualDetails = ((BeanCollection<T>)cached).getActualDetails();
List<Object> 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);
}
@@ -745,7 +745,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
*/
public int lazyLoadBatchSize() {
int batchSize = query.getLazyLoadBatchSize();
return (batchSize > 0) ? batchSize : server.getLazyLoadBatchSize();
return (batchSize > 0) ? batchSize : server.lazyLoadBatchSize();
}
/**
@@ -761,7 +761,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
* Return the base table alias for this query.
*/
public String baseTableAlias() {
return query.getAlias(beanDescriptor.getBaseTableAlias());
return query.getAlias(beanDescriptor.baseTableAlias());
}
/**
@@ -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]);
}
@@ -150,10 +150,10 @@ public final class PersistRequestBean<T> 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;
@@ -169,7 +169,7 @@ public final class PersistRequestBean<T> 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);
@@ -199,7 +199,7 @@ public final class PersistRequestBean<T> 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);
}
/**
@@ -210,7 +210,7 @@ public final class PersistRequestBean<T> 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);
}
/**
@@ -272,28 +272,28 @@ public final class PersistRequestBean<T> 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);
}
}
}
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);
}
}
@@ -495,10 +495,10 @@ public final class PersistRequestBean<T> 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);
@@ -618,7 +618,7 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
* </p>
*/
public String fullName() {
return beanDescriptor.getFullName();
return beanDescriptor.fullName();
}
/**
@@ -704,21 +704,21 @@ public final class PersistRequestBean<T> 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
@@ -752,7 +752,7 @@ public final class PersistRequestBean<T> 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
@@ -855,7 +855,7 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
}
private void changeLog() {
BeanChange changeLogBean = beanDescriptor.getChangeLogBean(this);
BeanChange changeLogBean = beanDescriptor.changeLogBean(this);
if (changeLogBean != null) {
transaction.addBeanChange(changeLogBean);
}
@@ -937,7 +937,7 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
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);
@@ -971,9 +971,9 @@ public final class PersistRequestBean<T> 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());
}
}
@@ -1101,9 +1101,9 @@ public final class PersistRequestBean<T> 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;
@@ -1154,9 +1154,9 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
} 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');
}
}
@@ -1170,7 +1170,7 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
* Return the table to update depending if the request is a 'publish' one or normal.
*/
public String updateTable() {
return publish ? beanDescriptor.getBaseTable() : beanDescriptor.getDraftTable();
return publish ? beanDescriptor.baseTable() : beanDescriptor.draftTable();
}
/**
@@ -1280,7 +1280,7 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
*/
@Override
public void profile() {
profileBase(type.profileEventId, profileOffset, beanDescriptor.getName(), 1);
profileBase(type.profileEventId, profileOffset, beanDescriptor.name(), 1);
}
/**
@@ -1341,7 +1341,7 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
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();
@@ -1377,7 +1377,7 @@ public final class PersistRequestBean<T> 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);
}
/**
@@ -26,7 +26,7 @@ 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<?> descriptor() {
@@ -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 {
@@ -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());
}
@@ -17,8 +17,8 @@ abstract class BaseCollectionHelp<T> implements BeanCollectionHelp<T> {
BaseCollectionHelp(BeanPropertyAssocMany<T> many) {
this.many = many;
this.targetDescriptor = many.getTargetDescriptor();
this.propertyName = many.getName();
this.targetDescriptor = many.targetDescriptor();
this.propertyName = many.name();
}
BaseCollectionHelp() {
@@ -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());
}
}
@@ -22,7 +22,7 @@ public final class BeanCollectionHelpFactory {
*/
public static <T> BeanCollectionHelp<T> create(BeanPropertyAssocMany<T> 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);
@@ -45,7 +45,7 @@ public final class BeanCollectionHelpFactory {
} else if (manyType == SpiQuery.Type.MAP) {
BeanDescriptor<T> target = request.descriptor();
ElPropertyValue elProperty = target.getElGetValue(request.query().getMapKey());
ElPropertyValue elProperty = target.elGetValue(request.query().getMapKey());
return new BeanMapQueryHelp<>(elProperty);
} else {
@@ -352,7 +352,7 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
/**
* Return the DatabaseConfig.
*/
public DatabaseConfig getConfig() {
return owner.getConfig();
public DatabaseConfig config() {
return owner.config();
}
/**
@@ -470,7 +470,7 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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,7 +776,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
/**
* Return true if this request should be included in the change log.
*/
public BeanChange getChangeLogBean(PersistRequestBean<T> request) {
public BeanChange changeLogBean(PersistRequestBean<T> request) {
switch (request.type()) {
case INSERT:
return changeLogFilter.includeInsert(request) ? insertBeanChange(request) : null;
@@ -869,14 +869,14 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
/**
* Return the default select clause.
*/
public String getDefaultSelectClause() {
public String defaultSelectClause() {
return defaultSelectClause;
}
@@ -999,12 +999,12 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
/**
* Return the natural key.
*/
public BeanNaturalKey getNaturalKey() {
public BeanNaturalKey naturalKey() {
return beanNaturalKey;
}
@@ -1421,13 +1421,13 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
public void readAuditMany(String queryKey, String bindLog, List<Object> ids) {
ReadEvent event = new ReadEvent(fullName, queryKey, bindLog, ids);
readAuditPrepare(event);
getReadAuditLogger().auditMany(event);
readAuditLogger().auditMany(event);
}
/**
@@ -1447,13 +1447,13 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
* <p>
* 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<T> implements BeanType<T>, 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();
@@ -1904,21 +1904,21 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
/**
* Return the BeanDescriptor of another bean type.
*/
public <U> BeanDescriptor<U> getBeanDescriptor(Class<U> otherType) {
return owner.getBeanDescriptor(otherType);
public <U> BeanDescriptor<U> descriptor(Class<U> otherType) {
return owner.descriptor(otherType);
}
/**
@@ -1953,7 +1953,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
/**
* Return the order column property.
*/
public BeanProperty getOrderColumn() {
public BeanProperty orderColumn() {
return orderColumn;
}
@@ -1964,7 +1964,7 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
/**
* Return bean class name.
*/
public String getDescriptorId() {
public String descriptorId() {
return fullName;
}
@@ -2000,7 +2000,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
*/
@Override
@Nonnull
public Class<T> getBeanType() {
public Class<T> type() {
return beanType;
}
@@ -2012,7 +2012,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
*/
@Override
@Nonnull
public String getFullName() {
public String fullName() {
return fullName;
}
@@ -2021,14 +2021,14 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
}
@Override
public Object beanId(Object bean) {
public Object id(Object bean) {
return getId((EntityBean) bean);
}
@@ -2136,7 +2136,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
* <p>
* 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> list, String sortByClause) {
list.sort(getElComparator(sortByClause));
list.sort(elComparator(sortByClause));
}
public ElComparator<T> getElComparator(String propNameOrSortBy) {
public ElComparator<T> elComparator(String propNameOrSortBy) {
return comparatorCache.computeIfAbsent(propNameOrSortBy, this::createComparator);
}
@@ -2217,10 +2217,10 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
}
private ElComparator<T> 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
* <p>
* 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
/**
* Return the compound unique constraints.
*/
public IndexDefinition[] getIndexDefinitions() {
public IndexDefinition[] indexDefinitions() {
return indexDefinitions;
}
@@ -2562,14 +2562,14 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
* Return the find controller (SPI interface).
*/
@Override
public BeanFindController getFindController() {
public BeanFindController findController() {
return beanFinder;
}
@@ -2585,7 +2585,7 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
* Return the Controller.
*/
@Override
public BeanPersistController getPersistController() {
public BeanPersistController persistController() {
return persistController;
}
@@ -2676,7 +2676,7 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
/**
* Return the associated draft table.
*/
public String getDraftTable() {
public String draftTable() {
return draftTable;
}
@@ -2759,27 +2759,27 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
* Return the identity generation type.
*/
@Override
public IdType getIdType() {
public IdType idType() {
return idType;
}
@@ -2952,7 +2952,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
return idGeneratedValue;
}
public IdentityMode getIdentityMode() {
public IdentityMode identityMode() {
return identityMode;
}
@@ -2962,7 +2962,7 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
final Set<String> 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<T> implements BeanType<T>, STreeType, SpiBeanType {
}
}
public TableJoin getPrimaryKeyJoin() {
public TableJoin primaryKeyJoin() {
return primaryKeyJoin;
}
@Override
public BeanProperty getIdProperty() {
public BeanProperty idProperty() {
return idProperty;
}
@@ -3124,7 +3124,7 @@ public class BeanDescriptor<T> implements BeanType<T>, 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<T> implements BeanType<T>, 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<T> implements BeanType<T>, STreeType, SpiBeanType {
* provides unique ordering of the rows (so that the paging is predicable).
*/
public void appendOrderById(SpiQuery<T> 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<T> implements BeanType<T>, STreeType, SpiBeanType {
* <p>
* Note that this DOES NOT find a version property on an embedded bean.
*/
public BeanProperty getVersionProperty() {
public BeanProperty versionProperty() {
return versionProperty;
}
@@ -3301,7 +3301,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
/**
* Return the tenant property when multi-tenant partitioning support is used.
*/
public BeanProperty getTenantProperty() {
public BeanProperty tenantProperty() {
return tenant;
}
@@ -3377,14 +3377,14 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
return jsonHelp.jsonRead(jsonRead, path, false);
}
public List<BeanProperty[]> getUniqueProps() {
public List<BeanProperty[]> uniqueProps() {
return propertiesUnique;
}
@Override
public List<BeanType<?>> getInheritanceChildren() {
public List<BeanType<?>> inheritanceChildren() {
if (hasInheritance()) {
return getInheritInfo().getChildren()
return inheritInfo().getChildren()
.stream()
.map(InheritInfo::desc)
.collect(Collectors.toList());
@@ -3394,14 +3394,14 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
}
@Override
public BeanType<?> getInheritanceParent() {
return getInheritInfo() == null ? null : getInheritInfo().getParent().desc();
public BeanType<?> inheritanceParent() {
return inheritInfo() == null ? null : inheritInfo().getParent().desc();
}
@Override
public void visitAllInheritanceChildren(Consumer<BeanType<?>> visitor) {
if (hasInheritance()) {
getInheritInfo().visitChildren(info -> visitor.accept(info.desc()));
inheritInfo().visitChildren(info -> visitor.accept(info.desc()));
}
}
}
@@ -124,7 +124,7 @@ final class BeanDescriptorCacheHelp<T> {
if (cacheNotifyOnAll || cacheNotifyOnDelete) {
String notifyMode = cacheNotifyOnAll ? "All" : "Delete";
logger.debug("l2 caching on {} - beanCaching:{} queryCaching:{} notifyMode:{} ",
desc.getFullName(), isBeanCaching(), isQueryCaching(), notifyMode);
desc.fullName(), isBeanCaching(), isQueryCaching(), notifyMode);
}
}
}
@@ -282,7 +282,7 @@ final class BeanDescriptorCacheHelp<T> {
// held as part of the bean cache so skip
return false;
}
CachedManyIds entry = manyPropGet(parentId, many.getName());
CachedManyIds entry = manyPropGet(parentId, many.name());
if (entry == null) {
// not in cache so return unsuccessful
return false;
@@ -290,7 +290,7 @@ final class BeanDescriptorCacheHelp<T> {
EntityBean ownerBean = bc.getOwnerBean();
EntityBeanIntercept ebi = ownerBean._ebean_getIntercept();
PersistenceContext persistenceContext = ebi.getPersistenceContext();
BeanDescriptor<?> targetDescriptor = many.getTargetDescriptor();
BeanDescriptor<?> targetDescriptor = many.targetDescriptor();
List<Object> idList = entry.getIdList();
bc.checkEmptyLazyLoad();
@@ -316,7 +316,7 @@ final class BeanDescriptorCacheHelp<T> {
// add as JSON to bean cache
String asJson = many.jsonWriteCollection(details);
Map<String, Object> changes = new HashMap<>();
changes.put(many.getName(), asJson);
changes.put(many.name(), asJson);
CachedBeanData newData = data.update(changes, data.getVersion());
if (beanLog.isDebugEnabled()) {
@@ -330,7 +330,7 @@ final class BeanDescriptorCacheHelp<T> {
} else {
CachedManyIds entry = createManyIds(many, details);
if (entry != null) {
cachePutManyIds(parentId, many.getName(), entry);
cachePutManyIds(parentId, many.name(), entry);
}
}
}
@@ -349,10 +349,10 @@ final class BeanDescriptorCacheHelp<T> {
return null;
}
BeanDescriptor<?> targetDescriptor = many.getTargetDescriptor();
BeanDescriptor<?> targetDescriptor = many.targetDescriptor();
List<Object> idList = new ArrayList<>(actualDetails.size());
for (Object bean : actualDetails) {
idList.add(targetDescriptor.beanId(bean));
idList.add(targetDescriptor.id(bean));
}
return new CachedManyIds(idList);
}
@@ -375,7 +375,7 @@ final class BeanDescriptorCacheHelp<T> {
for (Map.Entry<Object, Object> entry : beanDataMap.entrySet()) {
CachedBeanData cachedBeanData = (CachedBeanData) entry.getValue();
T bean = convertToBean(entry.getKey(), false, context, cachedBeanData);
result.add(bean, desc.beanId(bean));
result.add(bean, desc.id(bean));
}
return result;
}
@@ -773,7 +773,7 @@ final class BeanDescriptorCacheHelp<T> {
void cacheUpdateQuery(boolean update, SpiTransaction transaction) {
if (invalidateQueryCache || cacheNotifyOnAll || (!update && cacheNotifyOnDelete)) {
transaction.getEvent().add(desc.getBaseTable(), false, update, !update);
transaction.getEvent().add(desc.baseTable(), false, update, !update);
}
}
@@ -816,7 +816,7 @@ final class BeanDescriptorCacheHelp<T> {
} else {
queryCacheClear(changeSet);
cacheDeleteImported(false, insertRequest.entityBean(), changeSet);
changeSet.addBeanInsert(desc.getBaseTable());
changeSet.addBeanInsert(desc.baseTable());
}
}
@@ -845,7 +845,7 @@ final class BeanDescriptorCacheHelp<T> {
Object details = many.getValue(updateRequest.entityBean());
CachedManyIds entry = createManyIds(many, details);
if (entry != null) {
changeSet.addManyPut(desc, many.getName(), id, entry);
changeSet.addManyPut(desc, many.name(), id, entry);
}
}
}
@@ -19,7 +19,7 @@ final class BeanDescriptorDraftHelp<T> {
BeanDescriptorDraftHelp(BeanDescriptor<T> desc) {
this.desc = desc;
this.draftDirty = desc.getDraftDirty();
this.draftDirty = desc.draftDirty();
this.resetProperties = resetProperties();
}
@@ -66,7 +66,7 @@ final class BeanDescriptorDraftHelp<T> {
}
EntityBean draft = (EntityBean) draftBean;
EntityBean live = (EntityBean) liveBean;
BeanProperty idProperty = desc.getIdProperty();
BeanProperty idProperty = desc.idProperty();
if (idProperty != null) {
idProperty.publish(draft, live);
}
@@ -74,7 +74,7 @@ final class BeanDescriptorDraftHelp<T> {
prop.publish(draft, live);
}
for (BeanPropertyAssocMany<?> many : desc.propertiesMany()) {
if (many.getTargetDescriptor().isDraftable()) {
if (many.targetDescriptor().isDraftable()) {
many.publishMany(draft, live);
}
}
@@ -86,13 +86,13 @@ final class BeanDescriptorDraftHelp<T> {
*/
void draftQueryOptimise(Query<T> query) {
for (BeanPropertyAssocOne<?> anOne : desc.propertiesOne()) {
if (anOne.getTargetDescriptor().isDraftableElement()) {
query.fetch(anOne.getName());
if (anOne.targetDescriptor().isDraftableElement()) {
query.fetch(anOne.name());
}
}
for (BeanPropertyAssocMany<?> aMany : desc.propertiesMany()) {
if (aMany.getTargetDescriptor().isDraftableElement()) {
query.fetch(aMany.getName());
if (aMany.targetDescriptor().isDraftableElement()) {
query.fetch(aMany.name());
}
}
}
@@ -35,7 +35,7 @@ abstract class BeanDescriptorElement<T> extends BeanDescriptor<T> {
}
@Override
public String getSimpleName() {
public String simpleName() {
return simpleName;
}
@@ -52,7 +52,7 @@ abstract class BeanDescriptorElement<T> extends BeanDescriptor<T> {
if (props.length != 1) {
throw new IllegalStateException("Expecting 1 property for element scalar but got " + Arrays.toString(props));
}
return props[0].getScalarType();
return props[0].scalarType();
}
/**
@@ -42,7 +42,7 @@ class BeanDescriptorElementEmbedded<T> extends BeanDescriptorElement<T> {
@Override
public void initialiseOther(BeanDescriptorInitContext initContext) {
super.initialiseOther(initContext);
this.targetDescriptor = embeddedProperty.getTargetDescriptor();
this.targetDescriptor = embeddedProperty.targetDescriptor();
}
@Override
@@ -26,8 +26,8 @@ class BeanDescriptorElementScalarMap<T> extends BeanDescriptorElement<T> {
if (props.length != 2) {
throw new IllegalStateException("Expecting 2 properties for key and value but got " + Arrays.toString(props));
}
this.scalarTypeKey = props[0].getScalarType();
this.scalarTypeVal = props[1].getScalarType();
this.scalarTypeKey = props[0].scalarType();
this.scalarTypeVal = props[1].scalarType();
this.stringKey = String.class.equals(scalarTypeKey.getType());
}
@@ -57,7 +57,7 @@ final class BeanDescriptorJsonHelp<T> {
// render the dirty properties
BeanProperty[] props = desc.propertiesNonTransient();
for (BeanProperty prop : props) {
if (dirtyProps[prop.getPropertyIndex()]) {
if (dirtyProps[prop.propertyIndex()]) {
prop.jsonWrite(writeJson, bean);
}
}
@@ -123,7 +123,7 @@ final class BeanDescriptorJsonHelp<T> {
JsonToken event = parser.nextToken();
if (JsonToken.FIELD_NAME == event) {
String key = parser.getCurrentName();
BeanProperty p = desc.getBeanProperty(key);
BeanProperty p = desc.beanProperty(key);
if (p != null) {
p.jsonRead(readJson, bean);
} else {
@@ -145,7 +145,7 @@ final class BeanDescriptorJsonHelp<T> {
desc.setUnmappedJson(bean, unmappedProperties);
}
Object contextBean = null;
Object id = desc.beanId(bean);
Object id = desc.id(bean);
if (!isNullOrZero(id)) {
// check if the bean has already been loaded
contextBean = readJson.persistenceContextPutIfAbsent(id, bean, desc);
@@ -136,8 +136,8 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
this.multiValueBind = config.getMultiValueBind();
this.idBinderFactory = new IdBinderFactory(databasePlatform.isIdInExpandedForm(), multiValueBind);
this.queryPlanTTLSeconds = this.config.getQueryPlanTTLSeconds();
this.asOfViewSuffix = getAsOfViewSuffix(databasePlatform, this.config);
String versionsBetweenSuffix = getVersionsBetweenSuffix(databasePlatform, this.config);
this.asOfViewSuffix = asOfViewSuffix(databasePlatform, this.config);
String versionsBetweenSuffix = versionsBetweenSuffix(databasePlatform, this.config);
this.readAnnotations = new ReadAnnotations(config.getGeneratedPropertyFactory(), asOfViewSuffix, versionsBetweenSuffix, this.config);
this.bootupClasses = config.getBootupClasses();
this.createProperties = config.getDeployCreateProperties();
@@ -183,19 +183,19 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
}
@Override
public ScalarType<?> getScalarType(String cast) {
public ScalarType<?> scalarType(String cast) {
return typeManager.getScalarType(cast);
}
@Override
public ScalarType<?> getScalarType(int jdbcType) {
public ScalarType<?> scalarType(int jdbcType) {
return typeManager.getScalarType(jdbcType);
}
/**
* Return the AsOfViewSuffix based on the DbHistorySupport.
*/
private String getAsOfViewSuffix(DatabasePlatform databasePlatform, DatabaseConfig serverConfig) {
private String asOfViewSuffix(DatabasePlatform databasePlatform, DatabaseConfig serverConfig) {
DbHistorySupport historySupport = databasePlatform.getHistorySupport();
// with historySupport returns a simple view suffix or the sql2011 as of timestamp suffix
return (historySupport == null) ? serverConfig.getAsOfViewSuffix() : historySupport.getAsOfViewSuffix(serverConfig.getAsOfViewSuffix());
@@ -204,7 +204,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
/**
* Return the versions between timestamp suffix based on the DbHistorySupport.
*/
private String getVersionsBetweenSuffix(DatabasePlatform databasePlatform, DatabaseConfig serverConfig) {
private String versionsBetweenSuffix(DatabasePlatform databasePlatform, DatabaseConfig serverConfig) {
DbHistorySupport historySupport = databasePlatform.getHistorySupport();
// with historySupport returns a simple view suffix or the sql2011 versions between timestamp suffix
return (historySupport == null) ? serverConfig.getAsOfViewSuffix() : historySupport.getVersionsBetweenSuffix(serverConfig.getAsOfViewSuffix());
@@ -216,7 +216,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
}
@Override
public DatabaseConfig getConfig() {
public DatabaseConfig config() {
return config;
}
@@ -225,38 +225,38 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
return docStoreFactory.createAdapter(descriptor, deploy);
}
public BeanDescriptor<?> getBeanDescriptorByQueueId(String queueId) {
public BeanDescriptor<?> descriptorByQueueId(String queueId) {
return descQueueMap.get(queueId);
}
@Override
public SpiBeanType getBeanType(Class<?> entityType) {
return getBeanDescriptor(entityType);
public SpiBeanType beanType(Class<?> entityType) {
return descriptor(entityType);
}
@Override
@SuppressWarnings("unchecked")
public <T> BeanDescriptor<T> getBeanDescriptor(Class<T> entityType) {
public <T> BeanDescriptor<T> descriptor(Class<T> entityType) {
return (BeanDescriptor<T>) descMap.get(entityType.getName());
}
@SuppressWarnings("unchecked")
public <T> BeanDescriptor<T> getBeanDescriptorByClassName(String entityClassName) {
public <T> BeanDescriptor<T> descriptorByClassName(String entityClassName) {
return (BeanDescriptor<T>) descMap.get(entityClassName);
}
@Override
public String getServerName() {
public String name() {
return serverName;
}
@Override
public SpiCacheManager getCacheManager() {
public SpiCacheManager cacheManager() {
return cacheManager;
}
@Override
public NamingConvention getNamingConvention() {
public NamingConvention namingConvention() {
return namingConvention;
}
@@ -277,7 +277,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
/**
* Return the map of base tables to draft tables.
*/
public Map<String, String> getDraftTableMap() {
public Map<String, String> draftTableMap() {
return draftTableMap;
}
@@ -369,7 +369,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
* Return the Encrypt key given the table and column name.
*/
@Override
public EncryptKey getEncryptKey(String tableName, String columnName) {
public EncryptKey encryptKey(String tableName, String columnName) {
return encryptKeyManager.getEncryptKey(tableName, columnName);
}
@@ -397,14 +397,14 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
/**
* Return the BeanDescriptors mapped to the table.
*/
public List<BeanDescriptor<?>> getBeanDescriptors(String tableName) {
public List<BeanDescriptor<?>> descriptors(String tableName) {
return tableToDescMap.get(tableName.toLowerCase());
}
/**
* Return the BeanDescriptors mapped to the table.
*/
public List<? extends BeanType<?>> getBeanTypes(String tableName) {
public List<? extends BeanType<?>> beanTypes(String tableName) {
return tableToDescMap.get(tableName.toLowerCase());
}
@@ -433,16 +433,16 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
*/
private void readTableToDescriptor() {
for (BeanDescriptor<?> desc : descMap.values()) {
String baseTable = desc.getBaseTable();
String baseTable = desc.baseTable();
if (baseTable != null) {
baseTable = baseTable.toLowerCase();
List<BeanDescriptor<?>> list = tableToDescMap.computeIfAbsent(baseTable, k -> new ArrayList<>(1));
list.add(desc);
}
if (desc.getEntityType() == EntityType.VIEW && desc.isQueryCaching()) {
if (desc.entityType() == EntityType.VIEW && desc.isQueryCaching()) {
// build map of tables to view entities dependent on those tables
// for the purpose of invalidating appropriate query caches
String[] dependentTables = desc.getDependentTables();
String[] dependentTables = desc.dependentTables();
if (dependentTables != null && dependentTables.length > 0) {
for (String depTable : dependentTables) {
depTable = depTable.toLowerCase();
@@ -508,23 +508,23 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
for (BeanDescriptor<?> d : descMap.values()) {
d.initLast();
if (!d.isEmbedded()) {
beanManagerMap.put(d.getFullName(), beanManagerFactory.create(d));
beanManagerMap.put(d.fullName(), beanManagerFactory.create(d));
checkForValidEmbeddedId(d);
}
}
}
private void checkForValidEmbeddedId(BeanDescriptor<?> d) {
IdBinder idBinder = d.getIdBinder();
IdBinder idBinder = d.idBinder();
if (idBinder instanceof IdBinderEmbedded) {
IdBinderEmbedded embId = (IdBinderEmbedded) idBinder;
BeanDescriptor<?> idBeanDescriptor = embId.getIdBeanDescriptor();
Class<?> idType = idBeanDescriptor.getBeanType();
Class<?> idType = idBeanDescriptor.type();
try {
idType.getDeclaredMethod("hashCode");
idType.getDeclaredMethod("equals", Object.class);
} catch (NoSuchMethodException e) {
checkMissingHashCodeOrEquals(e, idType, d.getBeanType());
checkMissingHashCodeOrEquals(e, idType, d.type());
}
}
}
@@ -546,11 +546,11 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
/**
* Return an immutable list of all the BeanDescriptors.
*/
public List<BeanDescriptor<?>> getBeanDescriptorList() {
public List<BeanDescriptor<?>> descriptorList() {
return immutableDescriptorList;
}
public BeanTable getBeanTable(Class<?> type) {
public BeanTable beanTable(Class<?> type) {
return beanTableMap.get(type);
}
@@ -562,11 +562,11 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
}
@SuppressWarnings("unchecked")
public <T> BeanManager<T> getBeanManager(Class<T> entityType) {
return (BeanManager<T>) getBeanManager(entityType.getName());
public <T> BeanManager<T> beanManager(Class<T> entityType) {
return (BeanManager<T>) beanManager(entityType.getName());
}
private BeanManager<?> getBeanManager(String beanClassName) {
private BeanManager<?> beanManager(String beanClassName) {
return beanManagerMap.get(beanClassName);
}
@@ -591,19 +591,19 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
* Return the bean deploy info for the given class.
*/
@SuppressWarnings("unchecked")
public <T> DeployBeanInfo<T> getDeploy(Class<T> cls) {
public <T> DeployBeanInfo<T> deploy(Class<T> cls) {
return (DeployBeanInfo<T>) deployInfoMap.get(cls);
}
private void registerBeanDescriptor(DeployBeanInfo<?> info) {
private void registerDescriptor(DeployBeanInfo<?> info) {
BeanDescriptor<?> desc = new BeanDescriptor<>(this, info.getDescriptor());
descMap.put(desc.getBeanType().getName(), desc);
descMap.put(desc.type().getName(), desc);
if (desc.isDocStoreMapped()) {
descQueueMap.put(desc.getDocStoreQueueId(), desc);
descQueueMap.put(desc.docStoreQueueId(), desc);
}
for (BeanPropertyAssocMany<?> many : desc.propertiesMany()) {
if (many.isElementCollection()) {
elementDescriptors.add(many.getElementDescriptor());
elementDescriptors.add(many.elementDescriptor());
}
}
}
@@ -640,7 +640,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
private void registerEmbeddedBean(DeployBeanInfo<?> info) {
readDeployAssociations(info);
registerBeanDescriptor(info);
registerDescriptor(info);
}
/**
@@ -711,7 +711,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
}
for (DeployBeanInfo<?> info : deployInfoMap.values()) {
if (!info.isEmbedded()) {
registerBeanDescriptor(info);
registerDescriptor(info);
}
}
}
@@ -785,7 +785,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
}
}
private DeployBeanDescriptor<?> getTargetDescriptor(DeployBeanPropertyAssoc<?> prop) {
private DeployBeanDescriptor<?> targetDescriptor(DeployBeanPropertyAssoc<?> prop) {
Class<?> targetType = prop.getTargetType();
DeployBeanInfo<?> info = deployInfoMap.get(targetType);
if (info == null) {
@@ -805,7 +805,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
Set<String> matchSet = new HashSet<>();
// get the bean descriptor that holds the mappedBy property
DeployBeanDescriptor<?> targetDesc = getTargetDescriptor(prop);
DeployBeanDescriptor<?> targetDesc = targetDescriptor(prop);
List<DeployBeanPropertyAssocOne<?>> ones = targetDesc.propertiesAssocOne();
for (DeployBeanPropertyAssocOne<?> possibleMappedBy : ones) {
Class<?> possibleMappedByType = possibleMappedBy.getTargetType();
@@ -866,7 +866,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
}
private void makeOrderColumn(DeployBeanPropertyAssocMany<?> oneToMany) {
DeployBeanDescriptor<?> targetDesc = getTargetDescriptor(oneToMany);
DeployBeanDescriptor<?> targetDesc = targetDescriptor(oneToMany);
DeployOrderColumn orderColumn = oneToMany.getOrderColumn();
final ScalarType<?> scalarType = typeManager.getScalarType(Integer.class);
DeployBeanProperty orderProperty = new DeployBeanProperty(targetDesc, Integer.class, scalarType, null);
@@ -898,7 +898,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
* into the order_id column on the order_lines table).
*/
private void makeUnidirectional(DeployBeanPropertyAssocMany<?> oneToMany) {
DeployBeanDescriptor<?> targetDesc = getTargetDescriptor(oneToMany);
DeployBeanDescriptor<?> targetDesc = targetDescriptor(oneToMany);
Class<?> owningType = oneToMany.getOwningType();
if (!oneToMany.getCascadeInfo().isSave()) {
// The property MUST have persist cascading so that inserts work.
@@ -915,7 +915,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
oneToMany.setUnidirectional();
// specify table and table alias...
BeanTable beanTable = getBeanTable(owningType);
BeanTable beanTable = beanTable(owningType);
// define the TableJoin
DeployTableJoin oneToManyJoin = oneToMany.getTableJoin();
@@ -951,7 +951,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
// its associated join information if it is available
String mappedBy = prop.getMappedBy();
// get the mappedBy property
DeployBeanDescriptor<?> targetDesc = getTargetDescriptor(prop);
DeployBeanDescriptor<?> targetDesc = targetDescriptor(prop);
DeployBeanProperty mappedProp = targetDesc.getBeanProperty(mappedBy);
if (mappedProp == null) {
String m = "Error on " + prop.getFullBeanName();
@@ -1008,7 +1008,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
// skip mapping check
return;
}
DeployBeanDescriptor<?> targetDesc = getTargetDescriptor(prop);
DeployBeanDescriptor<?> targetDesc = targetDescriptor(prop);
if (targetDesc.isDraftableElement()) {
// automatically turning on orphan removal and CascadeType.ALL
@@ -1087,14 +1087,14 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
// get the bean descriptor that holds the mappedBy property
String mappedBy = prop.getMappedBy();
if (mappedBy == null) {
if (getTargetDescriptor(prop).isDraftable()) {
if (targetDescriptor(prop).isDraftable()) {
prop.setIntersectionDraftTable();
}
return;
}
// get the mappedBy property
DeployBeanDescriptor<?> targetDesc = getTargetDescriptor(prop);
DeployBeanDescriptor<?> targetDesc = targetDescriptor(prop);
DeployBeanProperty mappedProp = targetDesc.getBeanProperty(mappedBy);
if (mappedProp == null) {
@@ -1433,14 +1433,14 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
* Return the changeLogPrepare (for setting user context into the ChangeSet
* in the foreground thread).
*/
public ChangeLogPrepare getChangeLogPrepare() {
public ChangeLogPrepare changeLogPrepare() {
return changeLogPrepare;
}
/**
* Return the changeLogListener (that actually does the logging).
*/
public ChangeLogListener getChangeLogListener() {
public ChangeLogListener changeLogListener() {
return changeLogListener;
}
@@ -1517,7 +1517,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
@Override
public int compare(BeanDescriptor<?> o1, BeanDescriptor<?> o2) {
return o1.getName().compareTo(o2.getName());
return o1.name().compareTo(o2.name());
}
}
}
@@ -20,22 +20,22 @@ public interface BeanDescriptorMap {
/**
* Return the name of the server/database.
*/
String getServerName();
String name();
/**
* Return the DatabaseConfig.
*/
DatabaseConfig getConfig();
DatabaseConfig config();
/**
* Return the Cache Manager.
*/
SpiCacheManager getCacheManager();
SpiCacheManager cacheManager();
/**
* Return the naming convention.
*/
NamingConvention getNamingConvention();
NamingConvention namingConvention();
/**
* Return true if multiple values can be bound as Array or Table Value and hence share the same query plan.
@@ -45,12 +45,12 @@ public interface BeanDescriptorMap {
/**
* Return the BeanDescriptor for a given class.
*/
<T> BeanDescriptor<T> getBeanDescriptor(Class<T> entityType);
<T> BeanDescriptor<T> descriptor(Class<T> entityType);
/**
* Return the Encrypt key given the table and column name.
*/
EncryptKey getEncryptKey(String tableName, String columnName);
EncryptKey encryptKey(String tableName, String columnName);
/**
* Create a IdBinder for this bean property.
@@ -65,18 +65,18 @@ public interface BeanDescriptorMap {
/**
* Return the scalarType for the given JDBC type.
*/
ScalarType<?> getScalarType(int jdbcType);
ScalarType<?> scalarType(int jdbcType);
/**
* Return the scalarType for the given logical type.
*/
ScalarType<?> getScalarType(String cast);
ScalarType<?> scalarType(String cast);
/**
* Return true if Jackson core is present on the classpath.
*/
boolean isJacksonCorePresent();
/**
* Returns true, if the given table (or view) is managed by ebean
* (= an entity exists)
@@ -19,7 +19,7 @@ final class BeanEmbeddedMetaFactory {
// we can get a BeanDescriptor for an Embedded bean
// and know that it is NOT recursive, as Embedded beans are
// only allow to hold simple scalar types...
BeanDescriptor<?> targetDesc = owner.getBeanDescriptor(prop.getTargetType());
BeanDescriptor<?> targetDesc = owner.descriptor(prop.getTargetType());
if (targetDesc == null) {
String msg = "Could not find BeanDescriptor for " + prop.getTargetType()
+ ". Perhaps the EmbeddedId class is not registered? See https://ebean.io/docs/trouble-shooting#not-registered";
@@ -34,7 +34,7 @@ final class BeanEmbeddedMetaFactory {
BeanProperty[] embeddedProperties = new BeanProperty[sourceProperties.length];
for (int i = 0; i < sourceProperties.length; i++) {
String propertyName = sourceProperties[i].getName();
String propertyName = sourceProperties[i].name();
Column column = propColMap.get(propertyName);
String dbColumn = dbColumn(columnPrefix, column, sourceProperties[i]);
boolean dbNullable = dbNullable(column, sourceProperties[i]);
@@ -49,7 +49,7 @@ final class BeanEmbeddedMetaFactory {
}
private static String dbColumn(String prefix, Column override, BeanProperty source) {
String dbCol = (override != null && !override.name().isEmpty()) ? override.name() : source.getDbColumn();
String dbCol = (override != null && !override.name().isEmpty()) ? override.name() : source.dbColumn();
return prefix == null ? dbCol : prefix + dbCol;
}
@@ -58,15 +58,15 @@ final class BeanEmbeddedMetaFactory {
}
private static int dbLength(Column override, BeanProperty source) {
return (override != null && (override.length() != 255)) ? override.length() : source.getDbLength();
return (override != null && (override.length() != 255)) ? override.length() : source.dbLength();
}
private static int dbScale(Column override, BeanProperty source) {
return (override != null && (override.scale() != 0)) ? override.scale() : source.getDbScale();
return (override != null && (override.scale() != 0)) ? override.scale() : source.dbScale();
}
private static String getDbColumnDefn(Column override, BeanProperty source) {
return (override != null && !override.columnDefinition().isEmpty()) ? override.columnDefinition() : source.getDbColumnDefn();
return (override != null && !override.columnDefinition().isEmpty()) ? override.columnDefinition() : source.dbColumnDefn();
}
}
@@ -42,7 +42,7 @@ public final class BeanFkeyProperty implements ElPropertyValue {
}
@Override
public int getFetchPreference() {
public int fetchPreference() {
// return some decently high value
return 1000;
}
@@ -101,17 +101,17 @@ public final class BeanFkeyProperty implements ElPropertyValue {
}
@Override
public String getDbColumn() {
public String dbColumn() {
return dbColumn;
}
@Override
public String getName() {
public String name() {
return name;
}
@Override
public String getElName() {
public String elName() {
return name;
}
@@ -119,7 +119,7 @@ public final class BeanFkeyProperty implements ElPropertyValue {
* Returns null as not an AssocOne.
*/
@Override
public Object[] getAssocIdValues(EntityBean value) {
public Object[] assocIdValues(EntityBean value) {
return null;
}
@@ -127,7 +127,7 @@ public final class BeanFkeyProperty implements ElPropertyValue {
* Returns null as not an AssocOne.
*/
@Override
public String getAssocIdExpression(String prefix, String operator) {
public String assocIdExpression(String prefix, String operator) {
return null;
}
@@ -135,7 +135,7 @@ public final class BeanFkeyProperty implements ElPropertyValue {
* Returns null as not an AssocOne.
*/
@Override
public String getAssocIdInExpr(String prefix) {
public String assocIdInExpr(String prefix) {
return null;
}
@@ -143,12 +143,12 @@ public final class BeanFkeyProperty implements ElPropertyValue {
* Returns null as not an AssocOne.
*/
@Override
public String getAssocIdInValueExpr(boolean not, int size) {
public String assocIdInValueExpr(boolean not, int size) {
return null;
}
@Override
public String getAssocIsEmpty(SpiExpressionRequest request, String path) {
public String assocIsEmpty(SpiExpressionRequest request, String path) {
throw new RuntimeException("Not Supported or Expected");
}
@@ -171,12 +171,12 @@ public final class BeanFkeyProperty implements ElPropertyValue {
}
@Override
public String getElPlaceholder(boolean encrypted) {
public String elPlaceholder(boolean encrypted) {
return placeHolder;
}
@Override
public String getElPrefix() {
public String elPrefix() {
return prefix;
}
@@ -186,12 +186,12 @@ public final class BeanFkeyProperty implements ElPropertyValue {
}
@Override
public int getJdbcType() {
public int jdbcType() {
return 0;
}
@Override
public BeanProperty getBeanProperty() {
public BeanProperty beanProperty() {
return null;
}
@@ -201,7 +201,7 @@ public final class BeanFkeyProperty implements ElPropertyValue {
}
@Override
public StringParser getStringParser() {
public StringParser stringParser() {
throw new RuntimeException("ElPropertyDeploy only - not implemented");
}
@@ -226,7 +226,7 @@ public final class BeanFkeyProperty implements ElPropertyValue {
}
@Override
public Property getProperty() {
public Property property() {
throw new RuntimeException("ElPropertyDeploy only - not implemented");
}
@@ -50,7 +50,7 @@ public class BeanListHelp<T> extends BaseCollectionHelp<T> {
public BeanCollection<T> createEmpty(EntityBean parentBean) {
BeanList<T> beanList = new BeanList<>(loader, parentBean, propertyName);
if (many != null) {
beanList.setModifyListening(many.getModifyListenMode());
beanList.setModifyListening(many.modifyListenMode());
}
return beanList;
}
@@ -59,7 +59,7 @@ public class BeanListHelp<T> extends BaseCollectionHelp<T> {
public BeanCollection<T> createReference(EntityBean parentBean) {
BeanList<T> beanList = new BeanList<>(loader, parentBean, propertyName);
beanList.setModifyListening(many.getModifyListenMode());
beanList.setModifyListening(many.modifyListenMode());
return beanList;
}
@@ -77,7 +77,7 @@ public class BeanListHelp<T> extends BaseCollectionHelp<T> {
List<?> currentList = (List<?>) many.getValue(parentBean);
newBeanList.setModifyListening(many.getModifyListenMode());
newBeanList.setModifyListening(many.modifyListenMode());
if (currentList == null) {
// the currentList is null? Not really expecting this...
@@ -87,7 +87,7 @@ public class BeanListHelp<T> extends BaseCollectionHelp<T> {
// normally this case, replace just the underlying list
BeanList<?> currentBeanList = (BeanList<?>) currentList;
currentBeanList.setActualList(newBeanList.getActualList());
currentBeanList.setModifyListening(many.getModifyListenMode());
currentBeanList.setModifyListening(many.modifyListenMode());
} else {
// replace the entire list with the BeanList
@@ -29,9 +29,9 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
*/
BeanMapHelp(BeanPropertyAssocMany<T> many) {
this.many = many;
this.targetDescriptor = many.getTargetDescriptor();
this.propertyName = many.getName();
this.beanProperty = targetDescriptor.getBeanProperty(many.getMapKey());
this.targetDescriptor = many.targetDescriptor();
this.propertyName = many.name();
this.beanProperty = targetDescriptor.beanProperty(many.mapKey());
}
@Override
@@ -39,9 +39,9 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
public BeanCollectionAdd getBeanCollectionAdd(Object bc, String mapKey) {
if (mapKey == null) {
mapKey = many.getMapKey();
mapKey = many.mapKey();
}
BeanProperty beanProp = targetDescriptor.getBeanProperty(mapKey);
BeanProperty beanProp = targetDescriptor.beanProperty(mapKey);
if (bc instanceof BeanMap<?, ?>) {
BeanMap<Object, Object> bm = (BeanMap<Object, Object>) bc;
@@ -85,7 +85,7 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
BeanMap<?, T> beanMap = new BeanMap<>(loader, ownerBean, propertyName);
if (many != null) {
beanMap.setModifyListening(many.getModifyListenMode());
beanMap.setModifyListening(many.modifyListenMode());
}
return beanMap;
}
@@ -108,7 +108,7 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
BeanMap beanMap = new BeanMap(loader, parentBean, propertyName);
if (many != null) {
beanMap.setModifyListening(many.getModifyListenMode());
beanMap.setModifyListening(many.modifyListenMode());
}
return beanMap;
}
@@ -125,7 +125,7 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
BeanMap<?, ?> newBeanMap = (BeanMap<?, ?>) bc;
Map<?, ?> current = (Map<?, ?>) many.getValue(parentBean);
newBeanMap.setModifyListening(many.getModifyListenMode());
newBeanMap.setModifyListening(many.modifyListenMode());
if (current == null) {
// the currentMap is null? Not really expecting this...
many.setValue(parentBean, newBeanMap);
@@ -134,7 +134,7 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
// normally this case, replace just the underlying list
BeanMap<?, ?> currentBeanMap = (BeanMap<?, ?>) current;
currentBeanMap.setActualMap(newBeanMap.getActualMap());
currentBeanMap.setModifyListening(many.getModifyListenMode());
currentBeanMap.setModifyListening(many.modifyListenMode());
} else {
// replace the entire set
@@ -14,7 +14,6 @@ import io.ebean.core.type.DocPropertyType;
import io.ebean.core.type.ScalarType;
import io.ebean.plugin.Property;
import io.ebean.text.StringParser;
import io.ebean.text.TextException;
import io.ebean.util.SplitName;
import io.ebeaninternal.api.SpiExpressionRequest;
import io.ebeaninternal.api.SpiQuery;
@@ -50,7 +49,6 @@ import java.io.IOException;
import java.lang.reflect.Field;
import java.sql.SQLException;
import java.sql.Types;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -269,7 +267,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
s = s.replace("${ta}", "${}");
if (dbEncrypted) {
s = dbEncryptFunction.getDecryptSql(s);
String namedParam = ":encryptkey_" + descriptor.getBaseTable() + "___" + dbColumn;
String namedParam = ":encryptkey_" + descriptor.baseTable() + "___" + dbColumn;
s = s.replace("?", namedParam);
}
}
@@ -286,7 +284,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
protected BeanProperty(BeanProperty source, BeanPropertyOverride override) {
this.descriptor = source.descriptor;
this.propertyIndex = source.propertyIndex;
this.name = source.getName();
this.name = source.name();
this.dbColumn = override.getDbColumn();
this.nullable = override.isDbNullable();
this.dbLength = override.getDbLength();
@@ -316,9 +314,9 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
this.secondaryTableJoin = source.secondaryTableJoin;
this.secondaryTableJoinPrefix = source.secondaryTableJoinPrefix;
this.dbComment = source.dbComment;
this.dbBind = source.getDbBind();
this.dbBind = source.dbBind();
this.dbEncrypted = source.isDbEncrypted();
this.dbEncryptedType = source.getDbEncryptedType();
this.dbEncryptedType = source.dbEncryptedType();
this.dbEncryptFunction = source.dbEncryptFunction;
this.dbRead = source.isDbRead();
this.dbInsertable = source.isDbInsertable();
@@ -329,18 +327,18 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
this.dbMigrationInfos = source.dbMigrationInfos;
this.inherited = source.isInherited();
this.owningType = source.owningType;
this.local = owningType.equals(descriptor.getBeanType());
this.local = owningType.equals(descriptor.type());
this.version = source.isVersion();
this.embedded = source.isEmbedded();
this.id = source.isId();
this.generatedProperty = source.getGeneratedProperty();
this.generatedProperty = source.generatedProperty();
this.getter = source.getter;
this.setter = source.setter;
this.dbType = source.getDbType(true);
this.dbType = source.dbType(true);
this.scalarType = source.scalarType;
this.lob = isLobType(dbType);
this.propertyType = source.getPropertyType();
this.field = source.getField();
this.propertyType = source.type();
this.field = source.field();
this.docOptions = source.docOptions;
this.unmappedJson = source.unmappedJson;
this.elPrefix = override.replace(source.elPrefix, source.dbColumn);
@@ -358,14 +356,14 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
public void initialise(BeanDescriptorInitContext initContext) {
// do nothing for normal BeanProperty
if (!isTransient && scalarType == null) {
throw new RuntimeException("No ScalarType assigned to " + descriptor.getFullName() + "." + getName());
throw new RuntimeException("No ScalarType assigned to " + descriptor.fullName() + "." + name());
}
}
/**
* Return the order this property appears in the bean.
*/
public int getDeployOrder() {
public int deployOrder() {
return deployOrder;
}
@@ -383,7 +381,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
/**
* Return the BeanDescriptor that owns this property.
*/
public BeanDescriptor<?> getBeanDescriptor() {
public BeanDescriptor<?> descriptor() {
return descriptor;
}
@@ -426,28 +424,28 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
/**
* Return the encrypt key for the column matching this property.
*/
public EncryptKey getEncryptKey() {
return descriptor.getEncryptKey(this);
public EncryptKey encryptKey() {
return descriptor.encryptKey(this);
}
@Override
public String getEncryptKeyAsString() {
return getEncryptKey().getStringValue();
public String encryptKeyAsString() {
return encryptKey().getStringValue();
}
public String getDecryptProperty(String propertyName) {
public String decryptProperty(String propertyName) {
return dbEncryptFunction.getDecryptSql(propertyName);
}
/**
* Return the SQL for the column including decryption function and column alias.
*/
private String getDecryptSqlWithColumnAlias(String tableAlias) {
return dbEncryptFunction.getDecryptSql(tableAlias + "." + this.getDbColumn()) + ENC_PREFIX + tableAlias + "_" + this.getDbColumn();
private String decryptSqlWithColumnAlias(String tableAlias) {
return dbEncryptFunction.getDecryptSql(tableAlias + "." + this.dbColumn()) + ENC_PREFIX + tableAlias + "_" + this.dbColumn();
}
@Override
public int getFetchPreference() {
public int fetchPreference() {
// return some decently high value - override on ToMany property
return 1000;
}
@@ -470,7 +468,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
* Returns null unless this property is using a secondary table. In that
* case this returns the logical property prefix.
*/
public String getSecondaryTableJoinPrefix() {
public String secondaryTableJoinPrefix() {
return secondaryTableJoinPrefix;
}
@@ -490,7 +488,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
ctx.pushTableAlias(ctx.getRelativePrefix(secondaryTableJoinPrefix));
}
if (dbEncrypted) {
ctx.appendRawColumn(getDecryptSqlWithColumnAlias(ctx.peekTableAlias()));
ctx.appendRawColumn(decryptSqlWithColumnAlias(ctx.peekTableAlias()));
ctx.addEncryptedProp(this);
} else {
ctx.appendColumn(dbColumn);
@@ -569,12 +567,12 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
}
@Override
public BeanProperty getBeanProperty() {
public BeanProperty beanProperty() {
return this;
}
@Override
public Property getProperty() {
public Property property() {
return this;
}
@@ -606,14 +604,14 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
/**
* Return the DB literal expression to set the deleted state to true.
*/
String getSoftDeleteDbSet() {
String softDeleteDbSet() {
return softDeleteDbSet;
}
/**
* Return the DB literal predicate used to filter out soft deleted rows from a query.
*/
String getSoftDeleteDbPredicate(String tableAlias) {
String softDeleteDbPredicate(String tableAlias) {
return tableAlias + softDeleteDbPredicate;
}
@@ -758,7 +756,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
}
@Override
public Object getVal(Object bean) {
public Object value(Object bean) {
return getValue((EntityBean) bean);
}
@@ -819,19 +817,19 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
*/
@Override
@Nonnull
public String getName() {
public String name() {
return name;
}
/**
* Return the position of this property in the enhanced bean.
*/
public int getPropertyIndex() {
public int propertyIndex() {
return propertyIndex;
}
@Override
public String getElName() {
public String elName() {
return name;
}
@@ -851,31 +849,31 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
}
@Override
public String getAssocIsEmpty(SpiExpressionRequest request, String path) {
public String assocIsEmpty(SpiExpressionRequest request, String path) {
// overridden in BanePropertyAssocMany
throw new RuntimeException("Not Supported or Expected");
}
@Override
public Object[] getAssocIdValues(EntityBean bean) {
public Object[] assocIdValues(EntityBean bean) {
// Returns null as not an AssocOne.
return null;
}
@Override
public String getAssocIdExpression(String prefix, String operator) {
public String assocIdExpression(String prefix, String operator) {
// Returns null as not an AssocOne.
return null;
}
@Override
public String getAssocIdInExpr(String prefix) {
public String assocIdInExpr(String prefix) {
// Returns null as not an AssocOne.
return null;
}
@Override
public String getAssocIdInValueExpr(boolean not, int size) {
public String assocIdInValueExpr(boolean not, int size) {
// Returns null as not an AssocOne.
return null;
}
@@ -906,12 +904,12 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
}
@Override
public String getElPlaceholder(boolean encrypted) {
public String elPlaceholder(boolean encrypted) {
return encrypted ? elPlaceHolderEncrypted : elPlaceHolder;
}
@Override
public String getElPrefix() {
public String elPrefix() {
return elPrefix;
}
@@ -919,8 +917,8 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
* Return the full name of this property.
*/
@Override
public String getFullBeanName() {
return descriptor.getFullName() + "." + name;
public String fullName() {
return descriptor.fullName() + "." + name;
}
/**
@@ -936,12 +934,12 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
*/
@Override
@SuppressWarnings(value = "unchecked")
public ScalarType<Object> getScalarType() {
public ScalarType<Object> scalarType() {
return scalarType;
}
@Override
public StringParser getStringParser() {
public StringParser stringParser() {
return scalarType;
}
@@ -951,7 +949,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
}
@Override
public int getJdbcType() {
public int jdbcType() {
return scalarType == null ? 0 : scalarType.getJdbcType();
}
@@ -963,21 +961,21 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
/**
* Return the DB max length (varchar) or precision (decimal).
*/
public int getDbLength() {
public int dbLength() {
return dbLength;
}
/**
* Return the DB scale for numeric columns.
*/
public int getDbScale() {
public int dbScale() {
return dbScale;
}
/**
* Return a specific column DDL definition if specified (otherwise null).
*/
public String getDbColumnDefn() {
public String dbColumnDefn() {
return dbColumnDefn;
}
@@ -987,7 +985,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
* For an Enum returns IN expression for the set of Enum values.
* </p>
*/
public Set<String> getDbCheckConstraintValues() {
public Set<String> dbCheckConstraintValues() {
if (scalarType instanceof ScalarTypeEnum) {
return ((ScalarTypeEnum<?>) scalarType).getDbCheckConstraintValues();
}
@@ -1007,28 +1005,28 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
/**
* Return the DB column default to use for DDL.
*/
public String getDbColumnDefault() {
public String dbColumnDefault() {
return dbColumnDefn != null ? null : dbColumnDefault;
}
/**
* Return the DDL-Migration Infos
*/
public List<DbMigrationInfo> getDbMigrationInfos() {
public List<DbMigrationInfo> dbMigrationInfos() {
return dbMigrationInfos;
}
/**
* Return the bean Field associated with this property.
*/
private Field getField() {
private Field field() {
return field;
}
/**
* Return the GeneratedValue. Used to generate update timestamp etc.
*/
public GeneratedProperty getGeneratedProperty() {
public GeneratedProperty generatedProperty() {
return generatedProperty;
}
@@ -1119,14 +1117,14 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
* The database column name this is mapped to.
*/
@Override
public String getDbColumn() {
public String dbColumn() {
return dbColumn;
}
/**
* Return the comment for the associated DB column.
*/
public String getDbComment() {
public String dbComment() {
return dbComment;
}
@@ -1135,7 +1133,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
*
* @param platformTypes Set as false when we want logical platform agnostic types.
*/
public int getDbType(boolean platformTypes) {
public int dbType(boolean platformTypes) {
if (platformTypes || !(scalarType instanceof ScalarTypeLogicalType)) {
return dbType;
}
@@ -1184,7 +1182,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
* Return the DB bind parameter. Typically is "?" but different for
* encrypted bind.
*/
public String getDbBind() {
public String dbBind() {
return dbBind;
}
@@ -1209,7 +1207,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
return dbEncrypted;
}
public int getDbEncryptedType() {
public int dbEncryptedType() {
return dbEncryptedType;
}
@@ -1305,7 +1303,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
*/
@Override
@Nonnull
public Class<?> getPropertyType() {
public Class<?> type() {
return propertyType;
}
@@ -1413,7 +1411,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
// change in behavior for #318
objValue = null;
String msg = "Error trying to use Jackson ObjectMapper to read transient property "
+ getFullBeanName() + " - consider marking this property with @JsonIgnore";
+ fullName() + " - consider marking this property with @JsonIgnore";
logger.error(msg, e);
}
}
@@ -117,10 +117,10 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
}
void initialiseTargetDescriptor(BeanDescriptorInitContext initContext) {
targetDescriptor = descriptor.getBeanDescriptor(targetType);
targetDescriptor = descriptor.descriptor(targetType);
if (!isTransient) {
targetIdBinder = targetDescriptor.getIdBinder();
targetInheritInfo = targetDescriptor.getInheritInfo();
targetIdBinder = targetDescriptor.idBinder();
targetInheritInfo = targetDescriptor.inheritInfo();
saveRecurseSkippable = targetDescriptor.isSaveRecurseSkippable();
if (!targetIdBinder.isComplexId()) {
targetIdProperty = targetIdBinder.getIdProperty();
@@ -129,14 +129,14 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
}
@Override
public int getFetchPreference() {
public int fetchPreference() {
return fetchPreference;
}
/**
* Return the extra configuration for the foreign key.
*/
public PropertyForeignKey getForeignKey() {
public PropertyForeignKey foreignKey() {
return foreignKey;
}
@@ -159,7 +159,7 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
*/
ElPropertyValue createElPropertyValue(String propName, String remainder, ElPropertyChainBuilder chain, boolean propertyDeploy) {
// associated or embedded bean
BeanDescriptor<?> embDesc = getTargetDescriptor();
BeanDescriptor<?> embDesc = targetDescriptor();
if (chain == null) {
chain = new ElPropertyChainBuilder(isEmbedded(), propName);
}
@@ -198,7 +198,7 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
* Return the mappedBy property.
* This will be null on the owning side.
*/
public String getMappedBy() {
public String mappedBy() {
return mappedBy;
}
@@ -208,19 +208,19 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
* This will return null for multiple Id properties.
* </p>
*/
public String getTargetIdProperty() {
public String targetIdProperty() {
return targetIdProperty;
}
/**
* Return the BeanDescriptor of the target.
*/
public BeanDescriptor<T> getTargetDescriptor() {
public BeanDescriptor<T> targetDescriptor() {
return targetDescriptor;
}
SpiEbeanServer server() {
return descriptor.getEbeanServer();
return descriptor.ebeanServer();
}
/**
@@ -233,8 +233,8 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
}
@Override
public IdBinder getIdBinder() {
return descriptor.getIdBinder();
public IdBinder idBinder() {
return descriptor.idBinder();
}
@Override
@@ -251,8 +251,8 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
}
@Override
public String getSoftDeletePredicate(String tableAlias) {
return targetDescriptor.getSoftDeletePredicate(tableAlias);
public String softDeletePredicate(String tableAlias) {
return targetDescriptor.softDeletePredicate(tableAlias);
}
/**
@@ -283,8 +283,8 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
* Return true if the unique id properties are all not null for this bean.
*/
public boolean hasId(EntityBean bean) {
BeanDescriptor<?> targetDesc = getTargetDescriptor();
BeanProperty idProp = targetDesc.getIdProperty();
BeanDescriptor<?> targetDesc = targetDescriptor();
BeanProperty idProp = targetDesc.idProperty();
// all the unique properties are non-null
return idProp == null || idProp.getValue(bean) != null;
}
@@ -296,7 +296,7 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
* set or map.
* </p>
*/
public Class<?> getTargetType() {
public Class<?> targetType() {
return targetType;
}
@@ -305,14 +305,14 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
* to this bean type.
*/
@Override
public String getExtraWhere() {
public String extraWhere() {
return extraWhere;
}
/**
* Return the elastic search doc for this embedded property.
*/
private String getDocStoreDoc() {
private String docStoreDoc() {
return docStoreDoc;
}
@@ -321,7 +321,7 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
*/
@Override
public void docStoreInclude(boolean includeByDefault, DocStructure docStructure) {
String embeddedDoc = getDocStoreDoc();
String embeddedDoc = docStoreDoc();
if (embeddedDoc == null) {
// not annotated so use include by default
// which is *ToOne included and *ToMany excluded
@@ -399,21 +399,21 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
/**
* Return the underlying BeanTable for this property.
*/
public BeanTable getBeanTable() {
public BeanTable beanTable() {
return beanTable;
}
/**
* return the join to use for the bean.
*/
public TableJoin getTableJoin() {
public TableJoin tableJoin() {
return tableJoin;
}
/**
* Get the persist info.
*/
public BeanCascadeInfo getCascadeInfo() {
public BeanCascadeInfo cascadeInfo() {
return cascadeInfo;
}
@@ -422,10 +422,10 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
* descriptor back to local database columns in the TableJoin.
*/
ImportedId createImportedId(BeanPropertyAssoc<?> owner, BeanDescriptor<?> target, TableJoin join) {
BeanProperty idProp = target.getIdProperty();
BeanProperty idProp = target.idProperty();
BeanProperty[] others = target.propertiesBaseScalar();
if (descriptor.isRawSqlBased()) {
String dbColumn = owner.getDbColumn();
String dbColumn = owner.dbColumn();
return new ImportedIdSimple(owner, dbColumn, null, idProp, 0);
}
if (idProp == null) {
@@ -445,7 +445,7 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
} else {
// embedded id
BeanPropertyAssocOne<?> embProp = (BeanPropertyAssocOne<?>) idProp;
BeanProperty[] embBaseProps = embProp.getTargetDescriptor().propertiesBaseScalar();
BeanProperty[] embBaseProps = embProp.targetDescriptor().propertiesBaseScalar();
ImportedIdSimple[] scalars = createImportedList(owner, cols, embBaseProps, others);
return new ImportedIdEmbedded(owner, embProp, scalars);
}
@@ -466,16 +466,16 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
boolean insertable = col.isInsertable();
boolean updateable = col.isUpdateable();
for (int j = 0; j < props.length; j++) {
if (props[j].getDbColumn().equalsIgnoreCase(matchColumn)) {
if (props[j].dbColumn().equalsIgnoreCase(matchColumn)) {
return new ImportedIdSimple(owner, localColumn, localSqlFormula, props[j], j, insertable, updateable);
}
}
for (int j = 0; j < others.length; j++) {
if (others[j].getDbColumn().equalsIgnoreCase(matchColumn)) {
if (others[j].dbColumn().equalsIgnoreCase(matchColumn)) {
return new ImportedIdSimple(owner, localColumn, localSqlFormula, others[j], j + props.length, insertable, updateable);
}
}
String msg = "Error with the Join on [" + getFullBeanName()
String msg = "Error with the Join on [" + fullName()
+ "]. Could not find the local match for [" + matchColumn + "] "//in table["+searchTable+"]?"
+ " Perhaps an error in a @JoinColumn";
throw new PersistenceException(msg);
@@ -566,7 +566,7 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
}
}
String msg = "Error with the Join on [" + getFullBeanName()
String msg = "Error with the Join on [" + fullName()
+ "]. Could not find the matching foreign key for [" + matchColumn + "] in table[" + searchTable + "]?"
+ " Perhaps using a @JoinColumn with the name/referencedColumnName attributes swapped? "
+ " or a @JoinColumn needs an explicit referencedColumnName specified?";
@@ -175,9 +175,9 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
*/
void initialisePostTarget() {
if (childMasterProperty != null) {
BeanProperty masterId = childMasterProperty.getTargetDescriptor().getIdProperty();
BeanProperty masterId = childMasterProperty.targetDescriptor().idProperty();
if (masterId != null) { // in docstore only, the master-id may be not available
childMasterIdProperty = childMasterProperty.getName() + "." + masterId.getName();
childMasterIdProperty = childMasterProperty.name() + "." + masterId.name();
}
}
}
@@ -200,7 +200,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
@Override
public void registerColumn(BeanDescriptor<?> desc, String prefix) {
if (targetDescriptor != null) {
desc.registerTable(targetDescriptor.getBaseTable(), this);
desc.registerTable(targetDescriptor.baseTable(), this);
}
}
@@ -208,8 +208,8 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
* Return the underlying collection of beans.
*/
@SuppressWarnings("rawtypes")
public Collection getRawCollection(EntityBean bean) {
return help.underlying(getVal(bean));
public Collection rawCollection(EntityBean bean) {
return help.underlying(value(bean));
}
/**
@@ -217,11 +217,11 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
*/
@Override
public void merge(EntityBean bean, EntityBean existing) {
Object existingCollection = getVal(existing);
Object existingCollection = value(existing);
if (existingCollection instanceof BeanCollection<?>) {
BeanCollection<?> toBC = (BeanCollection<?>) existingCollection;
if (!toBC.isPopulated()) {
Object fromCollection = getVal(bean);
Object fromCollection = value(bean);
if (fromCollection instanceof BeanCollection<?>) {
BeanCollection<?> fromBC = (BeanCollection<?>) fromCollection;
if (fromBC.isPopulated()) {
@@ -375,7 +375,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
/**
* Return the mode for listening to modifications to collections for this association.
*/
public ModifyListenMode getModifyListenMode() {
public ModifyListenMode modifyListenMode() {
return modifyListenMode;
}
@@ -410,19 +410,19 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
}
@Override
public String getAssocIsEmpty(SpiExpressionRequest request, String path) {
public String assocIsEmpty(SpiExpressionRequest request, String path) {
boolean softDelete = targetDescriptor.isSoftDelete();
boolean needsX2Table = softDelete || getExtraWhere() != null;
boolean needsX2Table = softDelete || extraWhere() != null;
StringBuilder sb = new StringBuilder(50);
SpiQuery<?> query = request.getQueryRequest().query();
if (hasJoinTable()) {
sb.append(query.isAsDraft() ? intersectionDraftTable : intersectionPublishTable);
} else {
sb.append(targetDescriptor.getBaseTable(query.getTemporalMode()));
sb.append(targetDescriptor.baseTable(query.getTemporalMode()));
}
if (needsX2Table && hasJoinTable()) {
sb.append(" x join ");
sb.append(targetDescriptor.getBaseTable(query.getTemporalMode()));
sb.append(targetDescriptor.baseTable(query.getTemporalMode()));
sb.append(" x2 on ");
inverseJoin.addJoin("x2", "x", sb);
} else {
@@ -435,17 +435,17 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
}
exportedProperties[i].appendWhere(sb, "x.", path);
}
if (getExtraWhere() != null) {
if (extraWhere() != null) {
sb.append(" and ");
if (hasJoinTable()) {
sb.append(getExtraWhere().replace("${ta}", "x2").replace("${mta}", "x"));
sb.append(extraWhere().replace("${ta}", "x2").replace("${mta}", "x"));
} else {
sb.append(getExtraWhere().replace("${ta}", "x"));
sb.append(extraWhere().replace("${ta}", "x"));
}
}
if (softDelete) {
String alias = hasJoinTable() ? "x2" : "x";
sb.append(" and ").append(targetDescriptor.getSoftDeletePredicate(alias));
sb.append(" and ").append(targetDescriptor.softDeletePredicate(alias));
}
return sb.toString();
}
@@ -454,32 +454,32 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
* Return the Id values from the given bean.
*/
@Override
public Object[] getAssocIdValues(EntityBean bean) {
return targetDescriptor.getIdBinder().getIdValues(bean);
public Object[] assocIdValues(EntityBean bean) {
return targetDescriptor.idBinder().getIdValues(bean);
}
/**
* Return the Id expression to add to where clause etc.
*/
@Override
public String getAssocIdExpression(String prefix, String operator) {
return targetDescriptor.getIdBinder().getAssocOneIdExpr(prefix, operator);
public String assocIdExpression(String prefix, String operator) {
return targetDescriptor.idBinder().getAssocOneIdExpr(prefix, operator);
}
/**
* Return the logical id value expression taking into account embedded id's.
*/
@Override
public String getAssocIdInValueExpr(boolean not, int size) {
return targetDescriptor.getIdBinder().getIdInValueExpr(not, size);
public String assocIdInValueExpr(boolean not, int size) {
return targetDescriptor.idBinder().getIdInValueExpr(not, size);
}
/**
* Return the logical id in expression taking into account embedded id's.
*/
@Override
public String getAssocIdInExpr(String prefix) {
return targetDescriptor.getIdBinder().getAssocIdInExpr(prefix);
public String assocIdInExpr(String prefix) {
return targetDescriptor.idBinder().getAssocIdInExpr(prefix);
}
@Override
@@ -521,7 +521,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
/**
* Return the many type.
*/
public ManyType getManyType() {
public ManyType manyType() {
return manyType;
}
@@ -554,7 +554,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
/**
* Return the element bean descriptor (for an element collection only).
*/
public BeanDescriptor<T> getElementDescriptor() {
public BeanDescriptor<T> elementDescriptor() {
return elementDescriptor;
}
@@ -562,7 +562,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
* ManyToMany only, join from local table to intersection table.
*/
@Override
public TableJoin getIntersectionTableJoin() {
public TableJoin intersectionTableJoin() {
return intersectionJoin;
}
@@ -585,21 +585,21 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
* Return the order by clause used to order the fetching of the data for
* this list, set or map.
*/
public String getFetchOrderBy() {
public String fetchOrderBy() {
return fetchOrderBy;
}
/**
* Return the order by for use when lazy loading the associated collection.
*/
public String getLazyFetchOrderBy() {
public String lazyFetchOrderBy() {
return lazyFetchOrderBy;
}
/**
* Return the default mapKey when returning a Map.
*/
public String getMapKey() {
public String mapKey() {
return mapKey;
}
@@ -631,11 +631,11 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
return help.createEmpty(parentBean);
}
private BeanCollectionAdd getBeanCollectionAdd(Object bc) {
private BeanCollectionAdd beanCollectionAdd(Object bc) {
return help.getBeanCollectionAdd(bc, null);
}
public Object getParentId(EntityBean parentBean) {
public Object parentId(EntityBean parentBean) {
return descriptor.getId(parentBean);
}
@@ -654,12 +654,12 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
* Create the array of ExportedProperty used to build reference objects.
*/
private ExportedProperty[] createExported() {
BeanProperty idProp = descriptor.getIdProperty();
BeanProperty idProp = descriptor.idProperty();
ArrayList<ExportedProperty> list = new ArrayList<>();
if (idProp != null && idProp.isEmbedded()) {
BeanPropertyAssocOne<?> one = (BeanPropertyAssocOne<?>) idProp;
try {
for (BeanProperty emId : one.getTargetDescriptor().propertiesBaseScalar()) {
for (BeanProperty emId : one.targetDescriptor().propertiesBaseScalar()) {
list.add(findMatch(true, emId));
}
} catch (PersistenceException e) {
@@ -680,9 +680,9 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
private ExportedProperty findMatch(boolean embedded, BeanProperty prop) {
if (hasJoinTable()) {
// look for column going to intersection
return findMatch(embedded, prop, prop.getDbColumn(), intersectionJoin);
return findMatch(embedded, prop, prop.dbColumn(), intersectionJoin);
} else {
return findMatch(embedded, prop, prop.getDbColumn(), tableJoin);
return findMatch(embedded, prop, prop.dbColumn(), tableJoin);
}
}
@@ -697,17 +697,17 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
return null;
}
// search for the property, to see if it exists
Class<?> beanType = descriptor.getBeanType();
BeanDescriptor<?> targetDesc = getTargetDescriptor();
Class<?> beanType = descriptor.type();
BeanDescriptor<?> targetDesc = targetDescriptor();
for (BeanPropertyAssocOne<?> prop : targetDesc.propertiesOne()) {
if (mappedBy != null) {
// match using mappedBy as property name
if (mappedBy.equalsIgnoreCase(prop.getName())) {
if (mappedBy.equalsIgnoreCase(prop.name())) {
return prop;
}
} else {
// assume only one property that matches parent object type
if (prop.getTargetType().equals(beanType)) {
if (prop.targetType().equals(beanType)) {
// found it, stop search
return prop;
}
@@ -721,21 +721,21 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
*/
private BeanProperty initMapKeyProperty() {
// search for the property
BeanDescriptor<?> targetDesc = getTargetDescriptor();
BeanDescriptor<?> targetDesc = targetDescriptor();
for (BeanProperty prop : targetDesc.propertiesAll()) {
if (mapKey.equalsIgnoreCase(prop.getName())) {
if (mapKey.equalsIgnoreCase(prop.name())) {
return prop;
}
}
String from = descriptor.getFullName();
String to = targetDesc.getFullName();
String from = descriptor.fullName();
String to = targetDesc.fullName();
throw new PersistenceException(from + ": Could not find mapKey property [" + mapKey + "] on [" + to + "]");
}
public IntersectionRow buildManyDeleteChildren(EntityBean parentBean, List<Object> excludeDetailIds) {
IntersectionRow row = new IntersectionRow(tableJoin.getTable(), targetDescriptor);
if (excludeDetailIds != null && !excludeDetailIds.isEmpty()) {
row.setExcludeIds(excludeDetailIds, getTargetDescriptor());
row.setExcludeIds(excludeDetailIds, targetDescriptor());
}
buildExport(row, parentBean);
return row;
@@ -777,7 +777,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
*/
public void intersectionBind(SqlUpdate sql, EntityBean parentBean, EntityBean other) {
if (embeddedExportedProperties) {
BeanProperty idProp = descriptor.getIdProperty();
BeanProperty idProp = descriptor.idProperty();
parentBean = (EntityBean) idProp.getValue(parentBean);
}
for (ExportedProperty exportedProperty : exportedProperties) {
@@ -788,7 +788,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
private void buildExport(IntersectionRow row, EntityBean parentBean) {
if (embeddedExportedProperties) {
BeanProperty idProp = descriptor.getIdProperty();
BeanProperty idProp = descriptor.idProperty();
parentBean = (EntityBean) idProp.getValue(parentBean);
}
for (ExportedProperty exportedProperty : exportedProperties) {
@@ -869,7 +869,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
draftVal.size();
Collection<T> actualDetails = draftVal.getActualDetails();
for (T bean : actualDetails) {
Object id = targetDescriptor.beanId(bean);
Object id = targetDescriptor.id(bean);
T liveBean = liveBeansAsMap.remove(id);
if (isManyToMany()) {
@@ -899,7 +899,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
Collection<?> liveBeans = liveVal.getActualDetails();
Map<Object, T> liveMap = new LinkedHashMap<>();
for (Object liveBean : liveBeans) {
Object id = targetDescriptor.beanId(liveBean);
Object id = targetDescriptor.id(liveBean);
liveMap.put(id, (T) liveBean);
}
return liveMap;
@@ -1016,7 +1016,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
return elementDescriptor.jsonReadCollection(readJson, parentBean);
}
BeanCollection<?> collection = createEmpty(parentBean);
BeanCollectionAdd add = getBeanCollectionAdd(collection);
BeanCollectionAdd add = beanCollectionAdd(collection);
do {
EntityBean detailBean = (EntityBean) targetDescriptor.jsonRead(readJson, name);
if (detailBean == null) {
@@ -1044,7 +1044,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
* Returns true, if we must create a m2m join table.
*/
public boolean createJoinTable() {
if (hasJoinTable() && getMappedBy() == null) {
if (hasJoinTable() && mappedBy() == null) {
// only create on other 'owning' side
return !descriptor.isTableManaged(intersectionJoin.getTable());
} else {
@@ -27,7 +27,7 @@ class BeanPropertyAssocManyJsonHelp {
*/
BeanPropertyAssocManyJsonHelp(BeanPropertyAssocMany<?> many) {
this.many = many;
boolean objectMapperPresent = many.getBeanDescriptor().getConfig().getClassLoadConfig().isJacksonObjectMapperPresent();
boolean objectMapperPresent = many.descriptor().config().getClassLoadConfig().isJacksonObjectMapperPresent();
this.jsonTransient = !objectMapperPresent ? null : new BeanPropertyAssocManyJsonTransient();
}
@@ -58,7 +58,7 @@ class BeanPropertyAssocManyJsonHelp {
*/
private void jsonReadTransientUsingObjectMapper(SpiJsonReader readJson, EntityBean parentBean) throws IOException {
if (jsonTransient == null) {
throw new IllegalStateException("Jackson ObjectMapper is required to read this Transient property " + many.getFullBeanName());
throw new IllegalStateException("Jackson ObjectMapper is required to read this Transient property " + many.fullName());
}
jsonTransient.jsonReadUsingObjectMapper(many, readJson, parentBean);
}
@@ -21,18 +21,18 @@ class BeanPropertyAssocManyJsonTransient {
*/
void jsonReadUsingObjectMapper(BeanPropertyAssocMany<?> many, SpiJsonReader readJson, EntityBean parentBean) throws IOException {
ObjectMapper mapper = readJson.getObjectMapper();
ManyType manyType = many.getManyType();
ManyType manyType = many.manyType();
Object value;
if (manyType.isMap()) {
// read map using Jackson object mapper with unknown key type
TypeFactory typeFactory = mapper.getTypeFactory();
JavaType target = typeFactory.constructType(many.getTargetType());
JavaType target = typeFactory.constructType(many.targetType());
MapType jacksonType = typeFactory.constructMapType(LinkedHashMap.class, TypeFactory.unknownType(), target);
value = mapper.readValue(readJson.getParser(), jacksonType);
} else {
// read list or set using Jackson object mapper
CollectionType jacksonType = mapper.getTypeFactory().constructCollectionType(manyType.getCollectionType(), many.getTargetType());
CollectionType jacksonType = mapper.getTypeFactory().constructCollectionType(manyType.getCollectionType(), many.targetType());
value = mapper.readValue(readJson.getParser(), jacksonType);
}
many.setValue(parentBean, value);
@@ -26,7 +26,7 @@ class BeanPropertyAssocManySqlHelp<T> {
this.many = many;
this.exportedProperties = exportedProperties;
this.hasJoinTable = many.hasJoinTable();
this.descriptor = many.getBeanDescriptor();
this.descriptor = many.descriptor();
this.exportedPropertyBindProto = deriveExportedPropertyBindProto();
String delStmt;
@@ -73,7 +73,7 @@ class BeanPropertyAssocManySqlHelp<T> {
@Override
public void visitEmbeddedScalar(BeanProperty p, BeanPropertyAssocOne<?> embedded) {
sb.append(",").append(p.getDbColumn());
sb.append(",").append(p.dbColumn());
colCount++;
}
@@ -84,7 +84,7 @@ class BeanPropertyAssocManySqlHelp<T> {
@Override
public void visitScalar(BeanProperty p, boolean allowNonNull) {
sb.append(",").append(p.getDbColumn());
sb.append(",").append(p.dbColumn());
colCount++;
}
@@ -118,13 +118,13 @@ class BeanPropertyAssocManySqlHelp<T> {
query.setM2MIncludeJoin(many.inverseJoin);
}
String rawWhere = deriveWhereParentIdSql(true, tableAlias);
String expr = descriptor.getParentIdInExpr(parentIds.size(), rawWhere);
String expr = descriptor.parentIdInExpr(parentIds.size(), rawWhere);
many.bindParentIdsIn(expr, parentIds, query);
}
List<Object> findIdsByParentId(Object parentId, Transaction t, List<Object> excludeDetailIds, boolean hard) {
String rawWhere = deriveWhereParentIdSql(false, "");
SpiEbeanServer server = descriptor.getEbeanServer();
SpiEbeanServer server = descriptor.ebeanServer();
SpiQuery<?> q = many.newQuery(server);
many.bindParentIdEq(rawWhere, parentId, q);
if (hard) {
@@ -141,7 +141,7 @@ class BeanPropertyAssocManySqlHelp<T> {
String inClause = buildInClauseBinding(parentIds.size(), exportedPropertyBindProto);
String expr = rawWhere + inClause;
SpiEbeanServer server = descriptor.getEbeanServer();
SpiEbeanServer server = descriptor.ebeanServer();
SpiQuery<?> q = many.newQuery(server);
//Query<?> q = server.find(propertyType);
many.bindParentIdsIn(expr, parentIds, q);
@@ -209,7 +209,7 @@ class BeanPropertyAssocManySqlHelp<T> {
private String buildInClauseBinding(int size, String bindProto) {
if (descriptor.isSimpleId()) {
return descriptor.getIdBinder().getIdInValueExpr(false, size);
return descriptor.idBinder().getIdInValueExpr(false, size);
}
StringBuilder sb = new StringBuilder(10 + (size * (bindProto.length() + 1)));
sb.append(" in");
@@ -79,7 +79,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
embeddedProps = overrideMeta.getProperties();
embeddedPropsMap = new HashMap<>();
for (BeanProperty embeddedProp : embeddedProps) {
embeddedPropsMap.put(embeddedProp.getName(), embeddedProp);
embeddedPropsMap.put(embeddedProp.name(), embeddedProp);
}
} else {
embeddedProps = null;
@@ -129,15 +129,15 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
// limit JoinColumn mapping to the @Id / primary key
TableJoinColumn[] columns = tableJoin.columns();
String foreignJoinColumn = columns[0].getForeignDbColumn();
String foreignIdColumn = targetDescriptor.getIdProperty().getDbColumn();
String foreignIdColumn = targetDescriptor.idProperty().dbColumn();
if (!foreignJoinColumn.equalsIgnoreCase(foreignIdColumn)) {
throw new PersistenceException("Mapping limitation - @JoinColumn on " + getFullBeanName() + " needs to map to a primary key as per Issue #529 "
throw new PersistenceException("Mapping limitation - @JoinColumn on " + fullName() + " needs to map to a primary key as per Issue #529 "
+ " - joining to " + foreignJoinColumn + " and not " + foreignIdColumn);
}
}
} else {
exportedProperties = createExported();
String delStmt = "delete from " + targetDescriptor.getBaseTable() + " where ";
String delStmt = "delete from " + targetDescriptor.baseTable() + " where ";
deleteByParentIdSql = delStmt + deriveWhereParentIdSql(false);
deleteByParentIdInSql = delStmt + deriveWhereParentIdSql(true);
}
@@ -175,13 +175,13 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
*/
void cacheClear() {
if (cacheNotifyRelationship) {
targetDescriptor.cacheManyPropClear(relationshipProperty.getName());
targetDescriptor.cacheManyPropClear(relationshipProperty.name());
}
}
void cacheClear(CacheChangeSet changeSet) {
if (cacheNotifyRelationship) {
changeSet.addManyClear(targetDescriptor, relationshipProperty.getName());
changeSet.addManyClear(targetDescriptor, relationshipProperty.name());
}
}
@@ -191,13 +191,13 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
void cacheDelete(boolean clear, EntityBean bean, CacheChangeSet changeSet) {
if (cacheNotifyRelationship) {
if (clear) {
changeSet.addManyClear(targetDescriptor, relationshipProperty.getName());
changeSet.addManyClear(targetDescriptor, relationshipProperty.name());
} else {
Object assocBean = getValue(bean);
if (assocBean != null) {
Object parentId = targetDescriptor.beanId(assocBean);
Object parentId = targetDescriptor.id(assocBean);
if (parentId != null) {
changeSet.addManyRemove(targetDescriptor, relationshipProperty.getName(), parentId);
changeSet.addManyRemove(targetDescriptor, relationshipProperty.name(), parentId);
}
}
}
@@ -218,7 +218,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
if (embedded) {
BeanProperty embProp = embeddedPropsMap.get(remainder);
if (embProp == null) {
String msg = "Embedded Property " + remainder + " not found in " + getFullBeanName();
String msg = "Embedded Property " + remainder + " not found in " + fullName();
throw new PersistenceException(msg);
}
if (chain == null) {
@@ -232,7 +232,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
}
@Override
public String getElPlaceholder(boolean encrypted) {
public String elPlaceholder(boolean encrypted) {
return encrypted ? elPlaceHolderEncrypted : elPlaceHolder;
}
@@ -268,17 +268,17 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
private List<Object> findIdsByParentId(Object parentId, Transaction t) {
String rawWhere = deriveWhereParentIdSql(false);
SpiEbeanServer server = server();
Query<?> q = server.find(getPropertyType());
Query<?> q = server.find(type());
bindParentIdEq(rawWhere, parentId, q);
return server.findIds(q, t);
}
private List<Object> findIdsByParentIdList(List<Object> parentIds, Transaction t) {
String rawWhere = deriveWhereParentIdSql(true);
String inClause = getIdBinder().getIdInValueExpr(false, parentIds.size());
String inClause = idBinder().getIdInValueExpr(false, parentIds.size());
String expr = rawWhere + inClause;
SpiEbeanServer server = server();
Query<?> q = server.find(getPropertyType());
Query<?> q = server.find(type());
bindParentIdsIn(expr, parentIds, q);
return server.findIds(q, t);
}
@@ -297,13 +297,13 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
}
} else {
if (targetIdProperty != null) {
BeanDescriptor<T> target = getTargetDescriptor();
BeanDescriptor<T> target = targetDescriptor();
String basePath = SplitName.add(prefix, name);
if (dbColumn != null) {
BeanProperty idProperty = target.getIdProperty();
desc.registerColumn(dbColumn, SplitName.add(basePath, idProperty.getName()));
BeanProperty idProperty = target.idProperty();
desc.registerColumn(dbColumn, SplitName.add(basePath, idProperty.name()));
}
desc.registerTable(target.getBaseTable(), this);
desc.registerTable(target.baseTable(), this);
}
}
}
@@ -312,7 +312,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
* Return meta data for the deployment of the embedded bean specific to this
* property.
*/
public BeanProperty[] getProperties() {
public BeanProperty[] properties() {
return embeddedProps;
}
@@ -320,7 +320,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
public void buildRawSqlSelectChain(String prefix, List<String> selectChain) {
prefix = SplitName.add(prefix, name);
if (!embedded) {
InheritInfo inheritInfo = targetDescriptor.getInheritInfo();
InheritInfo inheritInfo = targetDescriptor.inheritInfo();
if (inheritInfo != null) {
// expect the discriminator column to be included in order
// to determine the inheritance type so we add it to the
@@ -330,7 +330,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
selectChain.add(discProperty);
}
if (targetIdBinder == null) {
throw new IllegalStateException("No Id binding property for " + getFullBeanName()
throw new IllegalStateException("No Id binding property for " + fullName()
+ ". Probably a missing @OneToOne mapping annotation on this relationship?");
}
targetIdBinder.buildRawSqlSelectChain(prefix, selectChain);
@@ -374,7 +374,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
String nextPrefix = (prefix == null) ? name : prefix + "." + name;
if (embedded) {
BeanDescriptor<T> targetDescriptor = getTargetDescriptor();
BeanDescriptor<T> targetDescriptor = targetDescriptor();
targetDescriptor.diff(nextPrefix, map, (EntityBean) newEmb, (EntityBean) oldEmb);
} else {
@@ -382,8 +382,8 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
newBean = (EntityBean) newEmb;
oldBean = (EntityBean) oldEmb;
BeanDescriptor<T> targetDescriptor = getTargetDescriptor();
BeanProperty idProperty = targetDescriptor.getIdProperty();
BeanDescriptor<T> targetDescriptor = targetDescriptor();
BeanProperty idProperty = targetDescriptor.idProperty();
Object newId = (newBean == null) ? null : idProperty.getValue(newBean);
Object oldId = (oldBean == null) ? null : idProperty.getValue(oldBean);
@@ -398,8 +398,8 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
* represents.
*/
@Override
public Class<?> getTargetType() {
return getPropertyType();
public Class<?> targetType() {
return type();
}
/**
@@ -424,19 +424,19 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
} else if (targetInheritInfo != null) {
return createCacheBeanId(ap);
} else {
return targetDescriptor.getIdProperty().getCacheDataValue((EntityBean) ap);
return targetDescriptor.idProperty().getCacheDataValue((EntityBean) ap);
}
}
private Object createCacheBeanId(Object bean) {
final BeanDescriptor<?> desc = targetDescriptor.descOf(bean.getClass());
final Object id = desc.getIdProperty().getCacheDataValue((EntityBean) bean);
return new CachedBeanId(desc.getDiscValue(), id);
final Object id = desc.idProperty().getCacheDataValue((EntityBean) bean);
return new CachedBeanId(desc.discValue(), id);
}
@Override
public String format(Object value) {
return targetDescriptor.getIdBinder().cacheKey(value);
return targetDescriptor.idBinder().cacheKey(value);
}
@Override
@@ -463,7 +463,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
private Object refBean(BeanDescriptor<?> desc, Object id, PersistenceContext context) {
if (id instanceof String) {
id = desc.getIdProperty().scalarType.parse((String) id);
id = desc.idProperty().scalarType.parse((String) id);
}
Object bean = desc.contextGet(context, id);
if (bean == null) {
@@ -473,44 +473,44 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
}
@Override
public ScalarDataReader<?> getIdReader() {
return targetDescriptor.getIdProperty();
public ScalarDataReader<?> idReader() {
return targetDescriptor.idProperty();
}
ScalarType<?> getIdScalarType() {
return targetDescriptor.getIdProperty().scalarType;
ScalarType<?> idScalarType() {
return targetDescriptor.idProperty().scalarType;
}
/**
* Return the Id values from the given bean.
*/
@Override
public Object[] getAssocIdValues(EntityBean bean) {
return targetDescriptor.getIdBinder().getIdValues(bean);
public Object[] assocIdValues(EntityBean bean) {
return targetDescriptor.idBinder().getIdValues(bean);
}
/**
* Return the Id expression to add to where clause etc.
*/
@Override
public String getAssocIdExpression(String prefix, String operator) {
return targetDescriptor.getIdBinder().getAssocOneIdExpr(prefix, operator);
public String assocIdExpression(String prefix, String operator) {
return targetDescriptor.idBinder().getAssocOneIdExpr(prefix, operator);
}
/**
* Return the logical id value expression taking into account embedded id's.
*/
@Override
public String getAssocIdInValueExpr(boolean not, int size) {
return targetDescriptor.getIdBinder().getIdInValueExpr(not, size);
public String assocIdInValueExpr(boolean not, int size) {
return targetDescriptor.idBinder().getIdInValueExpr(not, size);
}
/**
* Return the logical id in expression taking into account embedded id's.
*/
@Override
public String getAssocIdInExpr(String prefix) {
return targetDescriptor.getIdBinder().getAssocIdInExpr(prefix);
public String assocIdInExpr(String prefix) {
return targetDescriptor.idBinder().getAssocIdInExpr(prefix);
}
@Override
@@ -528,7 +528,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
* value.
*/
public Object createEmbeddedId() {
return getTargetDescriptor().createEntityBean();
return targetDescriptor().createEntityBean();
}
@Override
@@ -541,7 +541,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
return value;
}
public ImportedId getImportedId() {
public ImportedId importedId() {
return importedId;
}
@@ -565,11 +565,11 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
* Create the array of ExportedProperty used to build reference objects.
*/
private ExportedProperty[] createExported() {
BeanProperty idProp = descriptor.getIdProperty();
BeanProperty idProp = descriptor.idProperty();
ArrayList<ExportedProperty> list = new ArrayList<>();
if (idProp != null && idProp.isEmbedded()) {
BeanPropertyAssocOne<?> one = (BeanPropertyAssocOne<?>) idProp;
BeanDescriptor<?> targetDesc = one.getTargetDescriptor();
BeanDescriptor<?> targetDesc = one.targetDescriptor();
BeanProperty[] emIds = targetDesc.propertiesBaseScalar();
try {
for (BeanProperty emId : emIds) {
@@ -591,14 +591,14 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
* Find the matching foreignDbColumn for a given local property.
*/
private ExportedProperty findMatch(boolean embeddedProp, BeanProperty prop) {
return findMatch(embeddedProp, prop, prop.getDbColumn(), tableJoin);
return findMatch(embeddedProp, prop, prop.dbColumn(), tableJoin);
}
@Override
public void appendSelect(DbSqlContext ctx, boolean subQuery) {
if (!isTransient) {
if (primaryKeyExport) {
descriptor.getIdProperty().appendSelect(ctx, subQuery);
descriptor.idProperty().appendSelect(ctx, subQuery);
} else {
localHelp.appendSelect(ctx, subQuery);
}
@@ -732,7 +732,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
if (value instanceof EntityBean) {
if (embedded) {
writeJson.writeFieldName(name);
BeanDescriptor<?> refDesc = descriptor.getBeanDescriptor(value.getClass());
BeanDescriptor<?> refDesc = descriptor.descriptor(value.getClass());
refDesc.jsonWriteForInsert(writeJson, (EntityBean) value);
} else {
jsonWriteTargetId(writeJson, (EntityBean) value);
@@ -744,7 +744,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
* Just write the Id property of the ToOne property.
*/
private void jsonWriteTargetId(SpiJsonWriter writeJson, EntityBean childBean) throws IOException {
BeanProperty idProperty = targetDescriptor.getIdProperty();
BeanProperty idProperty = targetDescriptor.idProperty();
if (idProperty != null) {
writeJson.writeStartObject(name);
idProperty.jsonWriteForInsert(writeJson, childBean);
@@ -765,7 +765,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
// Hmmm, not writing complex non-entity bean
if (value instanceof EntityBean) {
writeJson.beginAssocOne(name, bean);
BeanDescriptor<?> refDesc = descriptor.getBeanDescriptor(value.getClass());
BeanDescriptor<?> refDesc = descriptor.descriptor(value.getClass());
refDesc.jsonWrite(writeJson, (EntityBean) value, name);
writeJson.endAssocOne();
}
@@ -795,7 +795,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
targetDescriptor.convertSetId(parentId, child);
}
if (mappedBy != null) {
BeanProperty beanProperty = targetDescriptor.getBeanProperty(mappedBy);
BeanProperty beanProperty = targetDescriptor.beanProperty(mappedBy);
if (beanProperty != null && beanProperty.getValue(child) == null) {
// set the 'parent' bean to the 'child' bean
beanProperty.setValue(child, parent);
@@ -54,7 +54,7 @@ public class BeanSetHelp<T> extends BaseCollectionHelp<T> {
public BeanCollection<T> createEmpty(EntityBean ownerBean) {
BeanSet<T> beanSet = new BeanSet<>(loader, ownerBean, propertyName);
if (many != null) {
beanSet.setModifyListening(many.getModifyListenMode());
beanSet.setModifyListening(many.modifyListenMode());
}
return beanSet;
}
@@ -62,7 +62,7 @@ public class BeanSetHelp<T> extends BaseCollectionHelp<T> {
@Override
public BeanCollection<T> createReference(EntityBean parentBean) {
BeanSet<T> beanSet = new BeanSet<>(loader, parentBean, propertyName);
beanSet.setModifyListening(many.getModifyListenMode());
beanSet.setModifyListening(many.modifyListenMode());
return beanSet;
}
@@ -76,7 +76,7 @@ public class BeanSetHelp<T> extends BaseCollectionHelp<T> {
public void refresh(BeanCollection<?> bc, EntityBean parentBean) {
BeanSet<?> newBeanSet = (BeanSet<?>) bc;
Set<?> current = (Set<?>) many.getValue(parentBean);
newBeanSet.setModifyListening(many.getModifyListenMode());
newBeanSet.setModifyListening(many.modifyListenMode());
if (current == null) {
// the currentList is null? Not really expecting this...
many.setValue(parentBean, newBeanSet);
@@ -85,7 +85,7 @@ public class BeanSetHelp<T> extends BaseCollectionHelp<T> {
// normally this case, replace just the underlying list
BeanSet<?> currentBeanSet = (BeanSet<?>) current;
currentBeanSet.setActualSet(newBeanSet.getActualSet());
currentBeanSet.setModifyListening(many.getModifyListenMode());
currentBeanSet.setModifyListening(many.modifyListenMode());
} else {
// replace the entire set
@@ -90,7 +90,7 @@ public final class BeanTable {
}
if (idProperty instanceof BeanPropertyAssocOne<?>) {
BeanPropertyAssocOne<?> assocOne = (BeanPropertyAssocOne<?>) idProperty;
BeanProperty[] props = assocOne.getProperties();
BeanProperty[] props = assocOne.properties();
for (BeanProperty prop : props) {
addToJoin(foreignKeyPrefix, join, reverse, sqlFormulaSelect, true, prop);
}
@@ -100,10 +100,10 @@ public final class BeanTable {
}
private void addToJoin(String foreignKeyPrefix, DeployTableJoin join, boolean reverse, String sqlFormulaSelect, boolean complexKey, BeanProperty prop) {
String lc = prop.getDbColumn();
String lc = prop.dbColumn();
String fk = lc;
if (foreignKeyPrefix != null) {
fk = owner.getNamingConvention().getForeignKey(foreignKeyPrefix, fk);
fk = owner.namingConvention().getForeignKey(foreignKeyPrefix, fk);
}
if (complexKey) {
// just to copy the column name rather than prefix with the foreignKeyPrefix.
@@ -12,7 +12,7 @@ public final class DCacheRegion implements SpiCacheRegion {
}
@Override
public String getName() {
public String name() {
return name;
}
@@ -7,7 +7,7 @@ final class DCacheRegionNone implements SpiCacheRegion {
static final SpiCacheRegion INSTANCE = new DCacheRegionNone();
@Override
public String getName() {
public String name() {
return "<none>";
}
@@ -56,15 +56,15 @@ public final class DeployPropertyParser extends DeployParser {
@Override
public String getDeployWord(String expression) {
ElPropertyDeploy elProp = beanDescriptor.getElPropertyDeploy(expression);
ElPropertyDeploy elProp = beanDescriptor.elPropertyDeploy(expression);
if (elProp == null) {
return null;
} else {
if (catchFirst && firstProp == null) {
firstProp = elProp;
}
addIncludes(elProp.getElPrefix());
return elProp.getElPlaceholder(encrypted);
addIncludes(elProp.elPrefix());
return elProp.elPlaceholder(encrypted);
}
}
@@ -73,11 +73,11 @@ public final class DeployUpdateParser extends DeployParser {
@Override
public String getDeployWord(String expression) {
if (expression.equalsIgnoreCase(beanDescriptor.getName())) {
return beanDescriptor.getBaseTable();
if (expression.equalsIgnoreCase(beanDescriptor.name())) {
return beanDescriptor.baseTable();
}
ElPropertyDeploy elProp = beanDescriptor.getElPropertyDeploy(expression);
return elProp != null ? elProp.getDbColumn() : null;
ElPropertyDeploy elProp = beanDescriptor.elPropertyDeploy(expression);
return elProp != null ? elProp.dbColumn() : null;
}
}
@@ -8,7 +8,7 @@ public final class DynamicPropertyAggregationFormulaMTO extends DynamicPropertyA
private final BeanPropertyAssocOne prop;
DynamicPropertyAggregationFormulaMTO(BeanPropertyAssocOne prop, String name, String parsedFormula, boolean aggregate, BeanProperty asTarget, String alias) {
super(name, prop.getIdScalarType(), parsedFormula, aggregate, asTarget, alias);
super(name, prop.idScalarType(), parsedFormula, aggregate, asTarget, alias);
this.prop = prop;
}
@@ -24,12 +24,12 @@ abstract class DynamicPropertyBase implements STreeProperty {
}
@Override
public String getName() {
public String name() {
return name;
}
@Override
public String getFullBeanName() {
public String fullName() {
return fullName;
}
@@ -49,12 +49,12 @@ abstract class DynamicPropertyBase implements STreeProperty {
}
@Override
public String getElPrefix() {
public String elPrefix() {
return elPrefix;
}
@Override
public ScalarType<?> getScalarType() {
public ScalarType<?> scalarType() {
return scalarType;
}
@@ -74,7 +74,7 @@ abstract class DynamicPropertyBase implements STreeProperty {
}
@Override
public String getEncryptKeyAsString() {
public String encryptKeyAsString() {
return null;
}
}
@@ -54,6 +54,6 @@ final class ExportedProperty {
if (path != null) {
sb.append(path).append(".");
}
sb.append(property.getName());
sb.append(property.name());
}
}
@@ -97,25 +97,25 @@ final class FormulaPropertyPath {
STreeProperty build() {
if (cast != null) {
ScalarType<?> scalarType = descriptor.getScalarType(cast);
ScalarType<?> scalarType = descriptor.scalarType(cast);
if (scalarType == null) {
throw new IllegalStateException("Unable to find scalarType for cast of [" + cast + "] on formula [" + formula + "] for type " + descriptor);
}
return create(scalarType);
}
if (isCount()) {
return create(descriptor.getScalarType(Types.BIGINT));
return create(descriptor.scalarType(Types.BIGINT));
}
if (isConcat()) {
return create(descriptor.getScalarType(Types.VARCHAR));
return create(descriptor.scalarType(Types.VARCHAR));
}
if (firstProp == null) {
throw new IllegalStateException("unable to determine scalarType of formula [" + formula + "] for type " + descriptor + " - maybe use a cast like ::String ?");
}
// determine scalarType based on first property found by parser
final BeanProperty property = firstProp.getBeanProperty();
final BeanProperty property = firstProp.beanProperty();
if (!property.isAssocId()) {
return create(property.getScalarType());
return create(property.scalarType());
} else {
return createManyToOne(property);
}
@@ -80,9 +80,9 @@ public final class InheritInfo {
*/
public void appendCheckConstraintValues(final String propertyName, final Set<String> checkConstraintValues) {
visitChildren(inheritInfo -> {
BeanProperty prop = inheritInfo.desc().getBeanProperty(propertyName);
BeanProperty prop = inheritInfo.desc().beanProperty(propertyName);
if (prop != null) {
Set<String> values = prop.getDbCheckConstraintValues();
Set<String> values = prop.dbCheckConstraintValues();
if (values != null) {
checkConstraintValues.addAll(values);
}
@@ -236,7 +236,7 @@ public final class InheritInfo {
* Return the IdBinder for this type.
*/
public IdBinder getIdBinder() {
return descriptor.getIdBinder();
return descriptor.idBinder();
}
/**
@@ -72,7 +72,7 @@ public final class IntersectionRow {
sb.append("delete from ").append(tableName);
} else {
sb.append("update ").append(tableName).append(" set ");
sb.append(targetDescriptor.getSoftDeleteDbSet());
sb.append(targetDescriptor.softDeleteDbSet());
}
sb.append(" where ");
int count = setBindParams(bindParams, sb);
@@ -35,13 +35,13 @@ public final class IdBinderEmbedded implements IdBinder {
public IdBinderEmbedded(boolean idInExpandedForm, BeanPropertyAssocOne<?> embIdProperty) {
this.idInExpandedForm = idInExpandedForm;
this.embIdProperty = embIdProperty;
this.idClass = "_idClass".equals(embIdProperty.getName());
this.idClass = "_idClass".equals(embIdProperty.name());
}
@Override
public void initialise() {
this.idDesc = embIdProperty.getTargetDescriptor();
this.props = embIdProperty.getProperties();
this.idDesc = embIdProperty.targetDescriptor();
this.props = embIdProperty.properties();
this.idInValueSql = idInExpandedForm ? idInExpanded() : idInCompressed();
}
@@ -57,7 +57,7 @@ public final class IdBinderEmbedded implements IdBinder {
if (i > 0) {
sb.append(" and ");
}
sb.append(idDesc.getBaseTableAlias()).append(".").append(props[i].getDbColumn()).append("=?");
sb.append(idDesc.baseTableAlias()).append(".").append(props[i].dbColumn()).append("=?");
}
sb.append(")");
return sb.toString();
@@ -91,9 +91,9 @@ public final class IdBinderEmbedded implements IdBinder {
sb.append(pathPrefix).append(".");
}
if (!idClass) {
sb.append(embIdProperty.getName()).append(".");
sb.append(embIdProperty.name()).append(".");
}
sb.append(props[i].getName());
sb.append(props[i].name());
if (!ascending) {
sb.append(" desc");
}
@@ -107,13 +107,13 @@ public final class IdBinderEmbedded implements IdBinder {
@Override
public String getIdProperty() {
return embIdProperty.getName();
return embIdProperty.name();
}
@Override
public void buildRawSqlSelectChain(String prefix, List<String> selectChain) {
if (!idClass) {
prefix = SplitName.add(prefix, embIdProperty.getName());
prefix = SplitName.add(prefix, embIdProperty.name());
}
for (BeanProperty prop : props) {
prop.buildRawSqlSelectChain(prefix, selectChain);
@@ -123,7 +123,7 @@ public final class IdBinderEmbedded implements IdBinder {
@Override
public BeanProperty findBeanProperty(String dbColumnName) {
for (BeanProperty prop : props) {
if (dbColumnName.equalsIgnoreCase(prop.getDbColumn())) {
if (dbColumnName.equalsIgnoreCase(prop.dbColumn())) {
return prop;
}
}
@@ -143,9 +143,9 @@ public final class IdBinderEmbedded implements IdBinder {
sb.append(", ");
}
if (!idClass) {
sb.append(embIdProperty.getName()).append(".");
sb.append(embIdProperty.name()).append(".");
}
sb.append(props[i].getName());
sb.append(props[i].name());
}
return sb.toString();
}
@@ -173,7 +173,7 @@ public final class IdBinderEmbedded implements IdBinder {
if (i > 0) {
sb.append(" and ");
}
sb.append(props[i].getDbColumn()).append("=?");
sb.append(props[i].dbColumn()).append("=?");
}
sb.append(")");
}
@@ -235,7 +235,7 @@ public final class IdBinderEmbedded implements IdBinder {
EntityBean ebValue = (EntityBean) embIdProperty.getValue(bean);
Map<String, Object> map = new LinkedHashMap<>();
for (BeanProperty prop : props) {
map.put(prop.getName(), prop.getValue(ebValue));
map.put(prop.name(), prop.getValue(ebValue));
}
return map;
}
@@ -249,7 +249,7 @@ public final class IdBinderEmbedded implements IdBinder {
Map<String, Object> map = (Map<String, Object>) value;
EntityBean idValue = idDesc.createEntityBean();
for (BeanProperty prop : props) {
prop.setValue(idValue, map.get(prop.getName()));
prop.setValue(idValue, map.get(prop.name()));
}
return idValue;
}
@@ -358,7 +358,7 @@ public final class IdBinderEmbedded implements IdBinder {
if (prefix != null) {
sb.append(prefix).append(".");
}
sb.append(props[i].getName());
sb.append(props[i].name());
}
sb.append(")");
return sb.toString();
@@ -375,9 +375,9 @@ public final class IdBinderEmbedded implements IdBinder {
sb.append(prefix).append(".");
}
if (!idClass) {
sb.append(embIdProperty.getName()).append(".");
sb.append(embIdProperty.name()).append(".");
}
sb.append(props[i].getName()).append(operator);
sb.append(props[i].name()).append(operator);
}
return sb.toString();
}
@@ -392,7 +392,7 @@ public final class IdBinderEmbedded implements IdBinder {
if (baseTableAlias != null) {
sb.append(baseTableAlias).append(".");
}
sb.append(props[i].getDbColumn()).append("=?");
sb.append(props[i].dbColumn()).append("=?");
}
return sb.toString();
}
@@ -411,7 +411,7 @@ public final class IdBinderEmbedded implements IdBinder {
if (baseTableAlias != null) {
sb.append(baseTableAlias).append(".");
}
sb.append(props[i].getDbColumn());
sb.append(props[i].dbColumn());
}
sb.append(")");
return sb.toString();
@@ -34,9 +34,9 @@ public final class IdBinderSimple implements IdBinder {
public IdBinderSimple(BeanProperty idProperty, MultiValueBind multiValueBind) {
this.idProperty = idProperty;
this.scalarType = idProperty.getScalarType();
this.expectedType = idProperty.getPropertyType();
bindIdSql = InternString.intern(idProperty.getDbColumn() + " = ? ");
this.scalarType = idProperty.scalarType();
this.expectedType = idProperty.type();
bindIdSql = InternString.intern(idProperty.dbColumn() + " = ? ");
this.multiValueBind = multiValueBind;
}
@@ -56,7 +56,7 @@ public final class IdBinderSimple implements IdBinder {
if (pathPrefix != null) {
sb.append(pathPrefix).append(".");
}
sb.append(idProperty.getName());
sb.append(idProperty.name());
if (!ascending) {
sb.append(" desc");
}
@@ -75,12 +75,12 @@ public final class IdBinderSimple implements IdBinder {
@Override
public String getIdProperty() {
return idProperty.getName();
return idProperty.name();
}
@Override
public BeanProperty findBeanProperty(String dbColumnName) {
if (dbColumnName.equalsIgnoreCase(idProperty.getDbColumn())) {
if (dbColumnName.equalsIgnoreCase(idProperty.dbColumn())) {
return idProperty;
}
return null;
@@ -93,15 +93,15 @@ public final class IdBinderSimple implements IdBinder {
@Override
public String getDefaultOrderBy() {
return idProperty.getName();
return idProperty.name();
}
@Override
public String getBindIdInSql(String baseTableAlias) {
if (baseTableAlias == null) {
return idProperty.getDbColumn();
return idProperty.dbColumn();
} else {
return baseTableAlias + "." + idProperty.getDbColumn();
return baseTableAlias + "." + idProperty.dbColumn();
}
}
@@ -216,7 +216,7 @@ public final class IdBinderSimple implements IdBinder {
sb.append(prefix);
sb.append(".");
}
sb.append(idProperty.getName());
sb.append(idProperty.name());
sb.append(operator);
return sb.toString();
}
@@ -228,7 +228,7 @@ public final class IdBinderSimple implements IdBinder {
sb.append(prefix);
sb.append(".");
}
sb.append(idProperty.getName());
sb.append(idProperty.name());
return sb.toString();
}
@@ -32,11 +32,11 @@ public final class ImportedIdEmbedded implements ImportedId {
@Override
public void addFkeys(String name) {
BeanProperty[] embeddedProps = foreignAssocOne.getProperties();
BeanProperty[] embeddedProps = foreignAssocOne.properties();
for (int i = 0; i < imported.length; i++) {
String n = name + "." + foreignAssocOne.getName() + "." + embeddedProps[i].getName();
BeanFkeyProperty fkey = new BeanFkeyProperty(n, imported[i].localDbColumn, foreignAssocOne.getDeployOrder());
owner.getBeanDescriptor().add(fkey);
String n = name + "." + foreignAssocOne.name() + "." + embeddedProps[i].name();
BeanFkeyProperty fkey = new BeanFkeyProperty(n, imported[i].localDbColumn, foreignAssocOne.deployOrder());
owner.descriptor().add(fkey);
}
}
@@ -88,8 +88,8 @@ public final class ImportedIdSimple implements ImportedId, Comparable<ImportedId
@Override
public void addFkeys(String name) {
BeanFkeyProperty fkey = new BeanFkeyProperty(name + "." + foreignProperty.getName(), localDbColumn, owner.getDeployOrder());
owner.getBeanDescriptor().add(fkey);
BeanFkeyProperty fkey = new BeanFkeyProperty(name + "." + foreignProperty.name(), localDbColumn, owner.deployOrder());
owner.descriptor().add(fkey);
}
@Override
@@ -192,7 +192,7 @@ public class DeployBeanDescriptor<T> {
* Return the DeployBeanInfo for the given bean class.
*/
DeployBeanInfo<?> getDeploy(Class<?> cls) {
return manager.getDeploy(cls);
return manager.deploy(cls);
}
public void setStorageEngine(String storageEngine) {
@@ -90,7 +90,7 @@ public final class DeployBeanPropertyLists {
discProperty = null;
}
BeanProperty beanProp = createBeanProperty(owner, prop);
propertyMap.put(beanProp.getName(), beanProp);
propertyMap.put(beanProp.name(), beanProp);
}
int order = 0;
@@ -102,13 +102,13 @@ public final class DeployBeanPropertyLists {
if (orderColumn != null) {
orderColumn.setDeployOrder(order);
allocateToList(orderColumn);
propertyMap.put(orderColumn.getName(), orderColumn);
propertyMap.put(orderColumn.name(), orderColumn);
}
if (discProperty != null) {
// put the discriminator property into the property map only
// (after the real properties have been organised into their lists)
propertyMap.put(discProperty.getName(), discProperty);
propertyMap.put(discProperty.name(), discProperty);
}
}
@@ -184,7 +184,7 @@ public final class DeployBeanPropertyLists {
}
if (prop.isId()) {
if (id != null) {
throw new IllegalStateException("More that one @Id property on " + desc.getFullName() + " ?");
throw new IllegalStateException("More that one @Id property on " + desc.fullName() + " ?");
}
id = prop;
return;
@@ -194,7 +194,7 @@ public final class DeployBeanPropertyLists {
mutable.add(prop);
}
if (desc.getInheritInfo() != null && prop.isLocal()) {
if (desc.inheritInfo() != null && prop.isLocal()) {
local.add(prop);
}
@@ -225,7 +225,7 @@ public final class DeployBeanPropertyLists {
if (versionProperty == null) {
versionProperty = prop;
} else {
logger.warn("Multiple @Version properties - property " + prop.getFullBeanName() + " not treated as a version property");
logger.warn("Multiple @Version properties - property " + prop.fullName() + " not treated as a version property");
}
} else if (prop.isDraftDirty()) {
draftDirty = prop;
@@ -356,7 +356,7 @@ public final class DeployBeanPropertyLists {
public BeanProperty[] getGeneratedInsert() {
List<BeanProperty> list = new ArrayList<>();
for (BeanProperty prop : nonTransients) {
GeneratedProperty gen = prop.getGeneratedProperty();
GeneratedProperty gen = prop.generatedProperty();
if (gen != null && gen.includeInInsert()) {
list.add(prop);
}
@@ -370,7 +370,7 @@ public final class DeployBeanPropertyLists {
public BeanProperty[] getGeneratedUpdate() {
List<BeanProperty> list = new ArrayList<>();
for (BeanProperty prop : nonTransients) {
GeneratedProperty gen = prop.getGeneratedProperty();
GeneratedProperty gen = prop.generatedProperty();
if (gen != null && gen.includeInUpdate()) {
list.add(prop);
}
@@ -391,12 +391,12 @@ public final class DeployBeanPropertyLists {
if (imported != prop.isOneToOneExported()) {
switch (mode) {
case Save:
if (prop.getCascadeInfo().isSave()) {
if (prop.cascadeInfo().isSave()) {
list.add(prop);
}
break;
case Delete:
if (prop.getCascadeInfo().isDelete()) {
if (prop.cascadeInfo().isDelete()) {
list.add(prop);
}
break;
@@ -3,8 +3,6 @@ package io.ebeaninternal.server.deploy.meta;
import io.ebeaninternal.server.deploy.BeanProperty;
import io.ebeaninternal.server.deploy.BeanTable;
import javax.persistence.JoinColumn;
/**
* A join pair of local and foreign properties.
*/
@@ -87,7 +85,7 @@ public final class DeployTableJoinColumn {
if (localDbColumn == null) {
BeanProperty idProperty = beanTable.getIdProperty();
if (idProperty != null) {
localDbColumn = idProperty.getDbColumn();
localDbColumn = idProperty.dbColumn();
}
}
}
@@ -29,7 +29,7 @@ abstract class AnnotationAssoc extends AnnotationParser {
}
BeanTable getBeanTable(DeployBeanPropertyAssoc<?> prop) {
return factory.getBeanTable(prop.getTargetType());
return factory.beanTable(prop.getTargetType());
}
private String errorMsgMissingBeanTable(Class<?> type, String from) {
@@ -154,13 +154,13 @@ final class AnnotationAssocManys extends AnnotationAssoc {
if (!prop.getTableJoin().hasJoinColumns() && beanTable != null) {
// use naming convention to define join (based on the bean name for this side of relationship)
// A unidirectional OneToMany or OneToMany with no mappedBy property
NamingConvention nc = factory.getNamingConvention();
NamingConvention nc = factory.namingConvention();
String fkeyPrefix = null;
if (nc.isUseForeignKeyPrefix()) {
fkeyPrefix = nc.getColumnFromProperty(descriptor.getBeanType(), descriptor.getName());
}
// Use the owning bean table to define the join
BeanTable owningBeanTable = factory.getBeanTable(descriptor.getBeanType());
BeanTable owningBeanTable = factory.beanTable(descriptor.getBeanType());
owningBeanTable.createJoinColumn(fkeyPrefix, prop.getTableJoin(), false, prop.getSqlFormulaSelect());
}
}
@@ -190,7 +190,7 @@ final class AnnotationAssocManys extends AnnotationAssoc {
fullTableName = descriptor.getBaseTable()+"_"+ CamelCaseHelper.toUnderscoreFromCamel(prop.getName());
}
BeanTable localTable = factory.getBeanTable(descriptor.getBeanType());
BeanTable localTable = factory.beanTable(descriptor.getBeanType());
if (collectionTable != null) {
prop.getTableJoin().addJoinColumn(util, true, collectionTable.joinColumns(), localTable);
}
@@ -198,8 +198,8 @@ final class AnnotationAssocManys extends AnnotationAssoc {
BeanProperty localId = localTable.getIdProperty();
if (localId != null) {
// add foreign key based on convention
String fkColName = namingConvention.getForeignKey(descriptor.getBaseTable(), localId.getName());
prop.getTableJoin().addJoinColumn(new DeployTableJoinColumn(localId.getDbColumn(), fkColName));
String fkColName = namingConvention.getForeignKey(descriptor.getBaseTable(), localId.name());
prop.getTableJoin().addJoinColumn(new DeployTableJoinColumn(localId.dbColumn(), fkColName));
}
}
@@ -296,8 +296,8 @@ final class AnnotationAssocManys extends AnnotationAssoc {
private void readJoinTable(JoinTable joinTable, DeployBeanPropertyAssocMany<?> prop) {
String intTableName = getFullTableName(joinTable);
if (intTableName.isEmpty()) {
BeanTable localTable = factory.getBeanTable(descriptor.getBeanType());
BeanTable otherTable = factory.getBeanTable(prop.getTargetType());
BeanTable localTable = factory.beanTable(descriptor.getBeanType());
BeanTable otherTable = factory.beanTable(prop.getTargetType());
intTableName = getM2MJoinTableName(localTable, otherTable);
}
@@ -362,8 +362,8 @@ final class AnnotationAssocManys extends AnnotationAssoc {
intTableName = intJoin.getTable();
}
BeanTable localTable = factory.getBeanTable(descriptor.getBeanType());
BeanTable otherTable = factory.getBeanTable(prop.getTargetType());
BeanTable localTable = factory.beanTable(descriptor.getBeanType());
BeanTable otherTable = factory.beanTable(prop.getTargetType());
final String localTableName = localTable.getUnqualifiedBaseTable();
final String otherTableName = otherTable.getUnqualifiedBaseTable();
@@ -386,8 +386,8 @@ final class AnnotationAssocManys extends AnnotationAssoc {
BeanProperty localId = localTable.getIdProperty();
if (localId != null) {
// add the source to intersection join columns
String fkCol = namingConvention.deriveM2MColumn(localTableName, localId.getDbColumn());
intJoin.addJoinColumn(new DeployTableJoinColumn(localId.getDbColumn(), fkCol));
String fkCol = namingConvention.deriveM2MColumn(localTableName, localId.dbColumn());
intJoin.addJoinColumn(new DeployTableJoinColumn(localId.dbColumn(), fkCol));
}
}
@@ -396,8 +396,8 @@ final class AnnotationAssocManys extends AnnotationAssoc {
BeanProperty otherId = otherTable.getIdProperty();
if (otherId != null) {
// set the intersection to dest table join columns
String fkCol = namingConvention.deriveM2MColumn(otherTableName, otherId.getDbColumn());
destJoin.addJoinColumn(new DeployTableJoinColumn(fkCol, otherId.getDbColumn()));
String fkCol = namingConvention.deriveM2MColumn(otherTableName, otherId.dbColumn());
destJoin.addJoinColumn(new DeployTableJoinColumn(fkCol, otherId.dbColumn()));
}
}
@@ -145,7 +145,7 @@ final class AnnotationAssocOnes extends AnnotationAssoc {
} else {
// use naming convention to define join.
NamingConvention nc = factory.getNamingConvention();
NamingConvention nc = factory.namingConvention();
String fkeyPrefix = null;
if (nc.isUseForeignKeyPrefix()) {
@@ -231,7 +231,7 @@ final class AnnotationAssocOnes extends AnnotationAssoc {
if (!primaryKeyJoin.referencedColumnName().isEmpty()) {
log.info("Automatically determining join columns for @PrimaryKeyJoinColumn - Ignoring PrimaryKeyJoinColumn.referencedColumnName attribute [{}] on {}", primaryKeyJoin.referencedColumnName(), prop.getFullBeanName());
}
BeanTable baseBeanTable = factory.getBeanTable(info.getDescriptor().getBeanType());
BeanTable baseBeanTable = factory.beanTable(info.getDescriptor().getBeanType());
String localPrimaryKey = baseBeanTable.getIdColumn();
String foreignColumn = getBeanTable(prop).getIdColumn();
prop.getTableJoin().addJoinColumn(new DeployTableJoinColumn(localPrimaryKey, foreignColumn, false, false));
@@ -21,11 +21,11 @@ public class VisitProperties {
}
protected void visitProperties(BeanDescriptor<?> desc, BeanPropertyVisitor propertyVisitor) {
BeanProperty idProp = desc.getIdProperty();
BeanProperty idProp = desc.idProperty();
if (idProp != null) {
visit(propertyVisitor, idProp);
}
BeanPropertyAssocOne<?> unidirectional = desc.getUnidirectional();
BeanPropertyAssocOne<?> unidirectional = desc.unidirectional();
if (unidirectional != null) {
visit(propertyVisitor, unidirectional);
}
@@ -51,7 +51,7 @@ public class VisitProperties {
if (assocOne.isEmbedded()) {
// Embedded bean
pv.visitEmbedded(assocOne);
BeanProperty[] embProps = assocOne.getProperties();
BeanProperty[] embProps = assocOne.properties();
for (BeanProperty embProp : embProps) {
pv.visitEmbeddedScalar(embProp, assocOne);
}
@@ -73,7 +73,7 @@ public class VisitProperties {
* Visit all the other inheritance properties that are not on the root.
*/
protected void visitInheritanceProperties(BeanDescriptor<?> descriptor, BeanPropertyVisitor pv) {
InheritInfo inheritInfo = descriptor.getInheritInfo();
InheritInfo inheritInfo = descriptor.inheritInfo();
if (inheritInfo != null && inheritInfo.isRoot()) {
// add all properties on the children objects
inheritInfo.visitChildren(new InheritChildVisitor(this, pv));
@@ -12,7 +12,7 @@ abstract class DtoQueryPlanBase implements DtoQueryPlan {
DtoQueryPlanBase(DtoMappingRequest request) {
this.planMetric = request.createMetric();
this.metric = planMetric.getMetric();
this.metric = planMetric.metric();
}
@Override
@@ -43,13 +43,13 @@ public final class ElComparatorProperty<T> implements Comparator<T>, ElComparato
return val2 == null ? 0 : nullOrder;
}
if (elGetValue.isAssocId()) {
val1 = elGetValue.getAssocIdValues((EntityBean) val1)[0]; // TODO: compound key not yet supported
val1 = elGetValue.assocIdValues((EntityBean) val1)[0]; // TODO: compound key not yet supported
}
if (val2 == null) {
return -1 * nullOrder;
}
if (elGetValue.isAssocId()) {
val2 = elGetValue.getAssocIdValues((EntityBean) val2)[0];
val2 = elGetValue.assocIdValues((EntityBean) val2)[0];
}
Comparable c = (Comparable) val1;
return asc * c.compareTo(val2);
@@ -24,18 +24,18 @@ public final class ElFilter<T> implements Filter<T> {
private Object convertValue(String propertyName, Object value) {
// convert type of value to match expected type
ElPropertyValue elGetValue = beanDescriptor.getElGetValue(propertyName);
ElPropertyValue elGetValue = beanDescriptor.elGetValue(propertyName);
return elGetValue.convert(value);
}
private ElComparator<T> getElComparator(String propertyName) {
return beanDescriptor.getElComparator(propertyName);
return beanDescriptor.elComparator(propertyName);
}
private ElPropertyValue getElGetValue(String propertyName) {
return beanDescriptor.getElGetValue(propertyName);
return beanDescriptor.elGetValue(propertyName);
}
@Override

Some files were not shown because too many files have changed in this diff Show More