1 package org.smartcomps.twister.engine.priv.core.definition;
2
3 import org.smartcomps.twister.common.persistence.DBSessionException;
4 import org.smartcomps.twister.engine.priv.core.definition.impl.PropertyImpl;
5 import org.smartcomps.twister.engine.priv.core.definition.impl.dao.PropertyDAO;
6 import org.smartcomps.twister.engine.priv.core.definition.Property;
7
8 /***
9 * A factory to create or get specific property instances.
10 */
11 public class PropertyFactory {
12
13 private PropertyDAO propDAO = new PropertyDAO();
14
15 public Property createProperty(String name, String type) throws DBSessionException {
16 PropertyImpl prop = new PropertyImpl();
17 prop.setName(name);
18 prop.setType(type);
19
20 prop = (PropertyImpl) propDAO.create(prop);
21
22 return prop;
23 }
24
25 public Property getByName(String name) throws DBSessionException {
26 return propDAO.findByName(name);
27 }
28 }
This page was automatically generated by Maven