From e30e35bf4f408d7ab462d0a2555e3a8883306070 Mon Sep 17 00:00:00 2001 From: Robin Bygrave Date: Fri, 31 Jul 2015 22:25:09 +1200 Subject: [PATCH] No effective change - code cleanup - remove unused --- .../server/deploy/DeployUpdateMapFactory.java | 57 ------------------- .../deploy/meta/DeployTableJoinColumn.java | 49 ---------------- 2 files changed, 106 deletions(-) delete mode 100644 src/main/java/com/avaje/ebeaninternal/server/deploy/DeployUpdateMapFactory.java diff --git a/src/main/java/com/avaje/ebeaninternal/server/deploy/DeployUpdateMapFactory.java b/src/main/java/com/avaje/ebeaninternal/server/deploy/DeployUpdateMapFactory.java deleted file mode 100644 index 93e5f80df..000000000 --- a/src/main/java/com/avaje/ebeaninternal/server/deploy/DeployUpdateMapFactory.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.avaje.ebeaninternal.server.deploy; - -import java.util.HashMap; -import java.util.Map; - -import com.avaje.ebeaninternal.server.deploy.id.ImportedId; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Build a map of logical to physical names for use in Orm Updates. - * - */ -public class DeployUpdateMapFactory { - - private static final Logger logger = LoggerFactory.getLogger(DeployUpdateMapFactory.class); - - /** - * Build a map of logical to physical names for use in Orm Updates for a given descriptor. - *

- * This includes the dbWrite scalar properties and imported foreign key properties. - *

- */ - public static Map build(BeanDescriptor descriptor) { - - Map deployMap = new HashMap(); - - String shortName = descriptor.getName(); - String beanName = shortName.toLowerCase(); - deployMap.put(beanName, descriptor.getBaseTable()); - - BeanProperty[] baseScalar = descriptor.propertiesBaseScalar(); - for (BeanProperty baseProp : baseScalar) { - // excluding formula, secondary table properties - if (baseProp.isDbInsertable() || baseProp.isDbUpdatable()){ - deployMap.put(baseProp.getName().toLowerCase(), baseProp.getDbColumn()); - } - } - - BeanPropertyAssocOne[] oneImported = descriptor.propertiesOneImported(); - for (BeanPropertyAssocOne assocOne : oneImported) { - - ImportedId importedId = assocOne.getImportedId(); - if (importedId == null){ - String m = descriptor.getFullName()+" importedId is null for associated: "+assocOne.getFullBeanName(); - logger.error(m); - - } else if (importedId.isScalar()){ - deployMap.put(importedId.getLogicalName(), importedId.getDbColumn()); - } - } - - return deployMap; - } - - -} diff --git a/src/main/java/com/avaje/ebeaninternal/server/deploy/meta/DeployTableJoinColumn.java b/src/main/java/com/avaje/ebeaninternal/server/deploy/meta/DeployTableJoinColumn.java index 75d0b9757..16c03a726 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/deploy/meta/DeployTableJoinColumn.java +++ b/src/main/java/com/avaje/ebeaninternal/server/deploy/meta/DeployTableJoinColumn.java @@ -98,37 +98,6 @@ public class DeployTableJoinColumn { return localDbColumn + " = " + foreignDbColumn; } - /** - * Return true if either the local or foreign column is null. - *

- * Both columns need to be defined. If one is null then typically it is - * derived as the primary key column. - *

- */ - public boolean hasNullColumn() { - return localDbColumn == null || foreignDbColumn == null; - } - - /** - * When only ONE column has been set by deployment information return that one. - *

- * Used with hasNullColumn() to set the foreignDbColumn for OneToMany joins. - *

- */ - public String getNonNullColumn() { - if (localDbColumn == null && foreignDbColumn == null) { - throw new IllegalStateException("expecting only one null column?"); - - } else if (localDbColumn != null && foreignDbColumn != null) { - throw new IllegalStateException("expecting one null column?"); - } - if (localDbColumn != null) { - return localDbColumn; - } else { - return foreignDbColumn; - } - } - /** * Return true if this column should be insertable. */ @@ -150,17 +119,6 @@ public class DeployTableJoinColumn { return foreignDbColumn; } - /** - * Set the foreign database column name. - *

- * Used when this is derived from Primary Key and not set explicitly in the - * deployment information. - *

- */ - public void setForeignDbColumn(String foreignDbColumn) { - this.foreignDbColumn = foreignDbColumn; - } - /** * Return the local database column name. */ @@ -168,11 +126,4 @@ public class DeployTableJoinColumn { return localDbColumn; } - /** - * Set the local database column name. - */ - public void setLocalDbColumn(String localDbColumn) { - this.localDbColumn = localDbColumn; - } - }