package mir.entity;
-import java.lang.*;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Set;
-import freemarker.template.*;
+import freemarker.template.TemplateListModel;
+import freemarker.template.TemplateModel;
-import mir.misc.*;
-import mir.storage.*;
-import mir.storage.store.*;
+import mir.log.LoggerWrapper;
+import mir.config.MirPropertiesConfiguration;
+import mir.config.MirPropertiesConfiguration.PropertiesConfigExc;
+import mir.storage.StorageObject;
+import mir.storage.store.StorableObject;
+import mir.storage.store.StoreContainerType;
+import mir.storage.store.StoreIdentifier;
+import mir.storage.store.StoreUtil;
/**
*
* @version 1.0 (freemarker compliant & and storable in ObjectStore)
*/
public class EntityList implements TemplateListModel, StorableObject {
-
- private static Logfile theLog;
+ protected static MirPropertiesConfiguration configuration;
+ protected LoggerWrapper logger;
private ArrayList theEntityArrayList = new ArrayList();
private String whereClause, orderClause;
private StorageObject theStorage;
static {
- theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Entity.Logfile"));
+ try {
+ configuration = MirPropertiesConfiguration.instance();
+ }
+ catch (PropertiesConfigExc e) {
+ throw new RuntimeException("Unable to get configuration: " + e.getMessage());
+ }
}
/**
* Constructor.
*/
- public EntityList(){ }
+ public EntityList(){
+ logger = new LoggerWrapper("Entity.List");
+ }
/* get/set EntityClass of Objects stored in EntityList */
public void setStorage(StorageObject storage) { this.theStorage=storage; }
if (anEntity!=null)
theEntityArrayList.add(anEntity);
else
- theLog.printWarning("EntityList: add called with empty Entity");
+ logger.warn("EntityList: add called with empty Entity");
}
StoreUtil.getEntityListUniqueIdentifierFor( theStorage.getTableName(),
whereClause, orderClause, offset, limit ));
}
- theLog.printWarning("EntityList could not return StoreIdentifier");
+ logger.warn("EntityList could not return StoreIdentifier");
return null;
}