mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Refactor DeployUtil rename methods (change/improve method names)
This commit is contained in:
@@ -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);
|
||||
|
||||
+3
-3
@@ -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<? extends Enum<?>> enumClass = (Class<? extends Enum<?>>)elementType;
|
||||
valueScalarType = util.getTypeManager().enumType(enumClass, EnumType.STRING);
|
||||
valueScalarType = util.typeManager().enumType(enumClass, EnumType.STRING);
|
||||
}
|
||||
|
||||
boolean scalar = true;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user