* Base class the entities are derived from. Provides base functionality of
* an entity.
*
- * @version $Id: AbstractEntity.java,v 1.8.2.7 2005/03/26 11:26:23 zapata Exp $
+ * @version $Id: AbstractEntity.java,v 1.8.2.8 2005/10/30 00:46:57 zapata Exp $
*/
public class AbstractEntity implements Entity {
protected Map values;
protected Database database;
- protected LoggerWrapper logger;
public AbstractEntity() {
- logger = new LoggerWrapper("Entity");
-
values = new HashMap();
}
/** {@inheritDoc} */
public String insert() throws DatabaseExc {
- logger.debug("Entity: trying to insert ...");
+ getLogger().debug("Entity: trying to insert ...");
if (database != null) {
return database.insert(this);
if (hasField(theProp))
values.put(theProp, theValue);
else {
- logger.warn("Entity.setFieldValue: Property not found: " + theProp + " (" + theValue + ")");
+ getLogger().warn("Entity.setFieldValue: Property not found: " + theProp + " (" + theValue + ")");
}
}
public boolean hasField(String fieldName) throws DatabaseFailure {
return getFieldNames().contains(fieldName);
}
+
+ protected LoggerWrapper getLogger() {
+ return new LoggerWrapper("Entity");
+ }
}