No effective change - code cleanup - remove unused

This commit is contained in:
Robin Bygrave
2015-07-31 22:25:09 +12:00
parent 2e1f02163c
commit e30e35bf4f
2 changed files with 0 additions and 106 deletions
@@ -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.
* <p>
* This includes the dbWrite scalar properties and imported foreign key properties.
* </p>
*/
public static Map<String,String> build(BeanDescriptor<?> descriptor) {
Map<String,String> deployMap = new HashMap<String,String>();
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;
}
}
@@ -98,37 +98,6 @@ public class DeployTableJoinColumn {
return localDbColumn + " = " + foreignDbColumn;
}
/**
* Return true if either the local or foreign column is null.
* <p>
* Both columns need to be defined. If one is null then typically it is
* derived as the primary key column.
* </p>
*/
public boolean hasNullColumn() {
return localDbColumn == null || foreignDbColumn == null;
}
/**
* When only ONE column has been set by deployment information return that one.
* <p>
* Used with hasNullColumn() to set the foreignDbColumn for OneToMany joins.
* </p>
*/
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.
* <p>
* Used when this is derived from Primary Key and not set explicitly in the
* deployment information.
* </p>
*/
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;
}
}