- public void update (Entity theEntity) throws StorageObjectException {
- Connection con = null;
- PreparedStatement pstmt = null;
+ public void update (Entity theEntity) throws StorageObjectException
+ {
+ Connection con = null; PreparedStatement pstmt = null;
+ /** @todo this is stupid: why do we prepare statement, when we
+ * throw it away afterwards. should be regular statement
+ * update/insert could better be one routine called save()
+ * that chooses to either insert or update depending if we
+ * have a primary key in the entity. i don't know if we
+ * still need the streamed input fields. // rk */
+
+ /** @todo extension: check if Entity did change, otherwise we don't need
+ * the roundtrip to the database */
+
+ /** invalidating corresponding entitylists in o_store*/
+ if ( StoreUtil.implementsStorableObject(theEntityClass) ) {
+ StoreContainerType stoc_type =
+ StoreContainerType.valueOf( theEntityClass,
+ StoreContainerType.STOC_TYPE_ENTITYLIST);
+ o_store.invalidate(stoc_type);
+ }
+