From cba3d24df129bc235bac69c0319720242121fa13 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Wed, 7 Sep 2022 22:56:43 +1200 Subject: [PATCH] Refactor DeployUtil rename methods (change/improve method names) --- .../server/deploy/BeanDescriptorManager.java | 2 +- .../deploy/parse/AnnotationAssocManys.java | 6 +++--- .../server/deploy/parse/AnnotationBase.java | 4 ++-- .../server/deploy/parse/AnnotationFields.java | 6 +++--- .../server/deploy/parse/DeployUtil.java | 16 ++++++++-------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanDescriptorManager.java b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanDescriptorManager.java index db5430566..5f2792f6c 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanDescriptorManager.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanDescriptorManager.java @@ -145,7 +145,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy this.dbIdentity = config.getDatabasePlatform().dbIdentity(); this.deplyInherit = config.getDeployInherit(); this.deployUtil = config.getDeployUtil(); - this.typeManager = deployUtil.getTypeManager(); + this.typeManager = deployUtil.typeManager(); this.beanManagerFactory = new BeanManagerFactory(config.getDatabasePlatform()); this.beanLifecycleAdapterFactory = new BeanLifecycleAdapterFactory(this.config); this.persistControllerManager = new PersistControllerManager(bootupClasses); diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationAssocManys.java b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationAssocManys.java index 538d7c715..0d29c3ba4 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationAssocManys.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationAssocManys.java @@ -222,7 +222,7 @@ final class AnnotationAssocManys extends AnnotationAssoc { dbKeyColumn = mapKeyColumn.name(); } - ScalarType keyScalarType = util.getTypeManager().type(prop.getMapKeyType()); + ScalarType keyScalarType = util.typeManager().type(prop.getMapKeyType()); DeployBeanProperty keyProp = new DeployBeanProperty(elementDescriptor, elementType, keyScalarType, null); setElementProperty(keyProp, "key", dbKeyColumn, sortOrder++); @@ -234,10 +234,10 @@ final class AnnotationAssocManys extends AnnotationAssoc { } } - ScalarType valueScalarType = util.getTypeManager().type(elementType); + ScalarType valueScalarType = util.typeManager().type(elementType); if (valueScalarType == null && elementType.isEnum()) { Class> enumClass = (Class>)elementType; - valueScalarType = util.getTypeManager().enumType(enumClass, EnumType.STRING); + valueScalarType = util.typeManager().enumType(enumClass, EnumType.STRING); } boolean scalar = true; diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationBase.java b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationBase.java index 1d182c6a6..35179b876 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationBase.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationBase.java @@ -52,9 +52,9 @@ abstract class AnnotationBase { AnnotationBase(DeployUtil util) { this.util = util; - this.databasePlatform = util.getDbPlatform(); + this.databasePlatform = util.dbPlatform(); this.platform = databasePlatform.platform(); - this.namingConvention = util.getNamingConvention(); + this.namingConvention = util.namingConvention(); } /** diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationFields.java b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationFields.java index 7111dbfac..b2b0a4dd7 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationFields.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationFields.java @@ -301,7 +301,7 @@ final class AnnotationFields extends AnnotationParser { private void initEncrypt(DeployBeanProperty prop) { if (!prop.isTransient()) { - EncryptDeploy encryptDeploy = util.getEncryptDeploy(info.getDescriptor().getBaseTableFull(), prop.getDbColumn()); + EncryptDeploy encryptDeploy = util.encryptDeploy(info.getDescriptor().getBaseTableFull(), prop.getDbColumn()); if (encryptDeploy == null || encryptDeploy.getMode() == Mode.MODE_ANNOTATION) { Encrypted encrypted = get(prop, Encrypted.class); if (encrypted != null) { @@ -398,7 +398,7 @@ final class AnnotationFields extends AnnotationParser { return; } if (dbEncString) { - DbEncrypt dbEncrypt = util.getDbPlatform().dbEncrypt(); + DbEncrypt dbEncrypt = util.dbPlatform().dbEncrypt(); if (dbEncrypt != null) { // check if we have a DB encryption function for this type int jdbcType = prop.getScalarType().jdbcType(); @@ -427,7 +427,7 @@ final class AnnotationFields extends AnnotationParser { private ScalarTypeBytesBase getDbEncryptType(DeployBeanProperty prop) { int dbType = prop.isLob() ? Types.BLOB : Types.VARBINARY; - return (ScalarTypeBytesBase) util.getTypeManager().type(dbType); + return (ScalarTypeBytesBase) util.typeManager().type(dbType); } private DataEncryptSupport createDataEncryptSupport(DeployBeanProperty prop) { diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/DeployUtil.java b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/DeployUtil.java index df0705f65..956de6314 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/DeployUtil.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/DeployUtil.java @@ -60,15 +60,15 @@ public final class DeployUtil { this.useValidationNotNull = config.isUseValidationNotNull(); } - public TypeManager getTypeManager() { + public TypeManager typeManager() { return typeManager; } - public DatabasePlatform getDbPlatform() { + public DatabasePlatform dbPlatform() { return dbPlatform; } - public NamingConvention getNamingConvention() { + public NamingConvention namingConvention() { return namingConvention; } @@ -82,7 +82,7 @@ public final class DeployUtil { } } - EncryptDeploy getEncryptDeploy(TableName table, String column) { + EncryptDeploy encryptDeploy(TableName table, String column) { if (encryptDeployManager == null) { return EncryptDeploy.ANNOTATION; } @@ -123,7 +123,7 @@ public final class DeployUtil { // this will be an Enum type... return; } - ScalarType scalarType = getScalarType(property); + ScalarType scalarType = scalarType(property); if (scalarType != null) { // set the jdbc type this maps to property.setDbType(scalarType.jdbcType()); @@ -132,7 +132,7 @@ public final class DeployUtil { } } - private ScalarType getScalarType(DeployBeanProperty property) { + private ScalarType scalarType(DeployBeanProperty property) { // Note that Temporal types already have dbType // set via annotations Class propType = property.getPropertyType(); @@ -193,7 +193,7 @@ public final class DeployUtil { } void setDbJsonType(DeployBeanProperty prop, DbJson dbJsonType) { - int dbType = getDbJsonStorage(dbJsonType.storage()); + int dbType = dbJsonStorage(dbJsonType.storage()); setDbJsonType(prop, dbType, dbJsonType.length(), dbJsonType.mutationDetection()); } @@ -219,7 +219,7 @@ public final class DeployUtil { /** * Return the JDBC type for the JSON storage type. */ - private int getDbJsonStorage(DbJsonType dbJsonType) { + private int dbJsonStorage(DbJsonType dbJsonType) { switch (dbJsonType) { case JSONB: return DbPlatformType.JSONB;