From: <sc...@hy...> - 2007-11-21 01:35:15
|
Author: scottmf Date: 2007-11-20 17:35:13 -0800 (Tue, 20 Nov 2007) New Revision: 6883 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=6883 Modified: trunk/src/org/hyperic/hq/common/server/session/CrispoManagerEJBImpl.java trunk/src/org/hyperic/hq/common/server/session/CrispoOptionDAO.java Log: [HHQ-1278] the insert was throwing exceptions since a null value was trying to be inserted into the EAM_CRISPO_OPT table, so I changed the CrispoManager to throw out those vals if they are null or match ^\s*$ Modified: trunk/src/org/hyperic/hq/common/server/session/CrispoManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/common/server/session/CrispoManagerEJBImpl.java 2007-11-21 01:24:04 UTC (rev 6882) +++ trunk/src/org/hyperic/hq/common/server/session/CrispoManagerEJBImpl.java 2007-11-21 01:35:13 UTC (rev 6883) @@ -142,8 +142,12 @@ * @ejb:interface-method */ public void updateOption(CrispoOption o, String val) { - o.setValue(val); - getCrispoOptionDAO().save(o); + if (val == null || val.matches("^\\s*$")) { + getCrispoOptionDAO().remove(o); + } else { + o.setValue(val); + getCrispoOptionDAO().save(o); + } } public static CrispoManagerLocal getOne() { Modified: trunk/src/org/hyperic/hq/common/server/session/CrispoOptionDAO.java =================================================================== --- trunk/src/org/hyperic/hq/common/server/session/CrispoOptionDAO.java 2007-11-21 01:24:04 UTC (rev 6882) +++ trunk/src/org/hyperic/hq/common/server/session/CrispoOptionDAO.java 2007-11-21 01:35:13 UTC (rev 6883) @@ -12,6 +12,10 @@ super(CrispoOption.class, f); } + void remove(CrispoOption o) { + super.remove(o); + } + void save(CrispoOption o) { super.save(o); } |