1 16 package com.blandware.atleap.persistence.hibernate.core; 17 18 import com.blandware.atleap.model.core.GlobalProperty; 19 import com.blandware.atleap.persistence.core.GlobalPropertyDAO; 20 21 import java.util.ArrayList ; 22 import java.util.List ; 23 24 25 34 public class GlobalPropertyDAOHibernate extends BaseDAOHibernate implements GlobalPropertyDAO { 35 36 39 public void createGlobalProperty(GlobalProperty globalProperty) { 40 getHibernateTemplate().save(globalProperty); 41 } 42 43 46 public GlobalProperty retrieveGlobalProperty(String propertyName) { 47 return (GlobalProperty) getHibernateTemplate().get(GlobalProperty.class, propertyName); 48 } 49 50 53 public void updateGlobalProperty(GlobalProperty globalProperty) { 54 getHibernateTemplate().update(globalProperty); 55 } 56 57 60 public void deleteGlobalProperty(GlobalProperty globalProperty) { 61 getHibernateTemplate().delete(globalProperty); 62 } 63 64 67 public List listDynamicProperties() { 68 String hql = "select p from GlobalProperty p order by p.name"; 69 List list = executeFind(hql); 70 if ( list == null ) { 71 list = new ArrayList (); 72 } 73 return list; 74 } 75 76 } 77 78 | Popular Tags |