- public boolean isField(String fieldName) throws StorageObjectFailure {
- return theStorageObject.getFields().contains(fieldName);
- }
-
- protected void throwStorageObjectFailure(Throwable e, String wo) throws StorageObjectFailure {
- logger.error(e.toString() + " function: " + wo);
- e.printStackTrace(logger.asPrintWriter(LoggerWrapper.DEBUG_MESSAGE));
-
- throw new StorageObjectFailure("Storage Object Exception in entity", e);
- }
-
- // Now implements freemarkers TemplateHashModel
- // two methods have to be overridden:
- // 1. public boolean isEmpty() throws TemplateModelException
- // 2. public TemplateModel get(java.lang.String key) throws TemplateModelException
-
- public boolean isEmpty() throws TemplateModelException {
- return (theValuesHash == null || theValuesHash.isEmpty()) ? true : false;
- }
-
- public TemplateModel get(java.lang.String key) throws TemplateModelException {
- return new SimpleScalar(getValue(key));
- }
-
- public void put(java.lang.String key, TemplateModel model) {
- // putting should only take place via setValue and is limited to the
- // database fields associated with the entity. no additional freemarker
- // stuff will be available via Entity.
- logger.warn("put is called on entity! - the values will be lost!");
- }
-
- public void remove(java.lang.String key) {
- // do we need this?
- }
-
- //////////////////////////////////////////////////////////////////////////////////