1 5 package org.exoplatform.services.database; 6 7 import java.io.Serializable ; 8 import net.sf.hibernate.Session; 9 import net.sf.hibernate.SessionFactory ; 10 11 18 public interface HibernateService { 19 static final String DIALECT_PROPERTY = "hibernate.dialect"; 20 static final String SHOW_SQL_PROPERTY = "hibernate.show_sql"; 21 static final String REFLECTION_OPTIMIZER_PROPERTY = "hibernate.cglib.use_reflection_optimizer"; 22 static final String CONNECTION_PROVIDER_PROPERTY = "hibernate.connection.provider_class"; 23 24 public String getServiceName() ; 25 26 public Session openSession() throws Exception ; 27 public Session openNewSession() throws Exception ; 28 public void closeSession(Session session) ; 29 30 public void closeSession() ; 31 public Object findOne(Session session, String query, String id) throws Exception ; 32 public Object findExactOne(Session session, String query, String id) throws Exception ; 33 public Object findOne(Class clazz, java.io.Serializable id) throws Exception ; 34 public Object findOne(ObjectQuery q) throws Exception ; 35 public Object create(Object obj) throws Exception ; 36 public Object update(Object obj) throws Exception ; 37 public Object save(Object obj) throws Exception ; 38 public Object remove(Object obj) throws Exception ; 39 public Object remove(Class clazz , Serializable id) throws Exception ; 40 public Object remove(Session session ,Class clazz , Serializable id) throws Exception ; 41 42 public SessionFactory getSessionFactory() throws Exception ; 43 public void addMappingFiles(String [] url) ; 44 45 } | Popular Tags |