protected void checkDowncast(Entity entity) {
   assertObjectNotNull("entity", entity);
   final Class<?> entityType = getEntityType();
   final Class<?> targetType = entity.getClass();
   if (!entityType.isAssignableFrom(targetType)) {
     final String titleName = DfTypeUtil.toClassTitle(entityType);
     String msg = "The entity should be " + titleName + " but it was: " + targetType;
     throw new IllegalStateException(msg);
   }
 }
 protected Map<String, Object> doConvertToColumnValueMap(Entity entity, boolean pkOnly) {
   final Map<String, Object> valueMap = newLinkedHashMap();
   final List<ColumnInfo> columnInfoList;
   if (pkOnly) {
     columnInfoList = getPrimaryUniqueInfo().getUniqueColumnList();
   } else {
     columnInfoList = getColumnInfoList();
   }
   final Set<String> specifiedProperties = entity.myspecifiedProperties();
   final boolean nonSpChecked = !specifiedProperties.isEmpty();
   for (ColumnInfo columnInfo : columnInfoList) {
     final String columnName = columnInfo.getColumnDbName();
     final Object value;
     if (nonSpChecked
         && !specifiedProperties.contains(columnInfo.getPropertyName())) { // non-specified column
       value = null; // to avoid non-specified check
     } else {
       value = columnInfo.read(entity);
     }
     valueMap.put(columnName, value);
   }
   return valueMap;
 }
 protected String xbRDS(Entity e, String name) { // buildRelationDisplayString()
   return e.buildDisplayString(name, true, true);
 }