From: <jt...@hy...> - 2007-12-06 22:49:55
|
Author: jtravis Date: 2007-12-06 14:49:51 -0800 (Thu, 06 Dec 2007) New Revision: 7128 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=7128 Modified: trunk/src/org/hyperic/hq/dao/ServiceDAO.java Log: Add create() which deals without value objects Modified: trunk/src/org/hyperic/hq/dao/ServiceDAO.java =================================================================== --- trunk/src/org/hyperic/hq/dao/ServiceDAO.java 2007-12-06 22:49:26 UTC (rev 7127) +++ trunk/src/org/hyperic/hq/dao/ServiceDAO.java 2007-12-06 22:49:51 UTC (rev 7128) @@ -63,6 +63,33 @@ super.remove(entity); } + public Service create(ServiceType type, Server server, String name, + String desc, String modifiedBy, String location, + String owner, Service parent) + { + ConfigResponseDB configResponse = + DAOFactory.getDAOFactory().getConfigResponseDAO().create(); + + Service s = new Service(); + s.setName(name); + s.setAutodiscoveryZombie(false); + s.setServiceRt(false); + s.setEndUserRt(false); + s.setDescription(desc); + s.setModifiedBy(modifiedBy); + s.setLocation(location); + s.setOwner(owner); + s.setParentService(parent); + s.setServiceType(type); + s.setServer(server); + s.setConfigResponse(configResponse); + save(s); + + server.addService(s); + + return s; + } + public Service create(ServiceValue sv, Server parent) { ConfigResponseDB configResponse = DAOFactory.getDAOFactory().getConfigResponseDAO().create(); |