/**
   * 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.
   */
  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.log(Level.SEVERE, m);

      } else if (importedId.isScalar()) {
        deployMap.put(importedId.getLogicalName(), importedId.getDbColumn());
      }
    }

    return deployMap;
  }
 /**
  * Return true if there is an imported bi-directional relationship to a bea that does have bean
  * caching enabled.
  */
 private boolean isNotifyOnDeletes() {
   for (BeanPropertyAssocOne<?> aPropertiesOneImported : propertiesOneImported) {
     if (aPropertiesOneImported.isCacheNotify()) {
       return true;
     }
   }
   return false;
 }
 /** Remove a bean from the cache given its Id. */
 void beanCacheRemove(Object id) {
   if (beanCache != null) {
     if (beanLog.isDebugEnabled()) {
       beanLog.debug("   REMOVE {}({})", cacheName, id);
     }
     beanCache.get().remove(id);
   }
   for (BeanPropertyAssocOne<?> aPropertiesOneImported : propertiesOneImported) {
     aPropertiesOneImported.cacheClear();
   }
 }
 private void cacheDeleteImported(boolean clear, EntityBean entityBean, CacheChangeSet changeSet) {
   for (BeanPropertyAssocOne<?> aPropertiesOneImported : propertiesOneImported) {
     aPropertiesOneImported.cacheDelete(clear, entityBean, changeSet);
   }
 }