/**
* Diese Klasse enthält die Daten eines MetaObjekts
*
- * @author RK, mh
- * @version $Id: EntityImages.java,v 1.11 2002/12/01 15:05:51 zapata Exp $
+ * @author RK, mh, mir-coders
+ * @version $Id: EntityImages.java,v 1.12 2002/12/06 08:08:14 mh Exp $
*/
webdbImage.setIcon(lobIcon.getOutputStream());
lobImage.close();
lobIcon.close();
- String sql = "update images set img_height='"
- +webdbImage.getImageHeight() +
- "',img_width='" + webdbImage.getImageWidth() +
- "',icon_height='" + webdbImage.getIconHeight() +
- "',icon_width='" + webdbImage.getIconWidth()
- + "', image_data="+oidImage+", icon_data="+oidIcon
- +" where id="+getId();
- theLog.printDebugInfo("settimage :: updating sizes: "+ sql);
- pstmt = con.prepareStatement(sql);
- //pstmt.setBytes(1, imageData);
- //pstmt.setBytes(2, iconData);
- pstmt.executeUpdate();
- sql="update content set is_produced='0' where to_media="+getId();
- pstmt = con.prepareStatement(sql);
- pstmt.executeUpdate();
+
+ setValueForProperty("img_height",
+ new Integer(webdbImage.getImageHeight()).toString());
+ setValueForProperty("img_width",
+ new Integer(webdbImage.getImageWidth()).toString());
+ setValueForProperty("icon_height",
+ new Integer(webdbImage.getIconHeight()).toString());
+ setValueForProperty("icon_width",
+ new Integer(webdbImage.getIconWidth()).toString());
+ setValueForProperty("image_data", new Integer(oidImage).toString());
+ setValueForProperty("icon_data", new Integer(oidIcon).toString());
+ update();
}
catch (Exception e) {
throwStorageObjectException(e, "settimage :: setImage gescheitert: ");
}
}
- public void update() throws StorageObjectException {
- super.update();
- try {
- theStorageObject.executeUpdate("update content set is_produced='0' where to_media="+getId());
- } catch (SQLException e) {
- throwStorageObjectException(e, "EntityImages :: update :: failed!! ");
- }
- }
-
- public void setValues(HashMap theStringValues)
- {
- if (theStringValues != null) {
- if (!theStringValues.containsKey("is_published"))
- theStringValues.put("is_published","0");
- }
- super.setValues(theStringValues);
- }
-
/**
* Takes an OutputStream as an argument and reads in the data
* from the DB and writes it to the OutputStream.
}
}
-}
\ No newline at end of file
+}