1 package org.splat.dal.dao.kernel;
5 * @author Daniel Brunier-Coulin
6 * @copyright OPEN CASCADE 2012
9 import org.hibernate.Session;
10 import org.splat.service.technical.IndexService;
11 import org.splat.service.technical.RepositoryService;
12 import org.springframework.beans.BeansException;
13 import org.springframework.context.ApplicationContext;
14 import org.springframework.context.ApplicationContextAware;
15 import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
16 import org.apache.log4j.Logger;
18 public abstract class Database extends HibernateDaoSupport implements
19 ApplicationContextAware {
22 * The ApplicationContext.
24 private static ApplicationContext _context = null;
27 * Spring will call this method for initialize the applicationContext.
30 * the application context
31 * @throws BeansException
34 public void setApplicationContext(final ApplicationContext ctx)
35 throws BeansException {
40 * Static for getting the context.
42 * @return ApplicationContext the application context
44 public static ApplicationContext getContext() {
48 // private static String CONFIG_FILE = "/hibernate.cfg.xml";
49 protected final static Logger logger = Logger.getLogger(Database.class);
51 // ==============================================================================================================================
53 // ==============================================================================================================================
55 protected String getSchemaVersion() {
56 // ------------------------------------
57 return null;// TODO: Get schema version into specific object/table: getIDPool().getSchemaVersion();
60 protected void setSchemaVersion(String version) {
61 // ------------------------------------------------
62 // TODO: Set schema version into specific object/table: myIDpool = new IDPool(version);
63 // getSession().save(myIDpool);
66 // ==============================================================================================================================
68 // ==============================================================================================================================
70 // if (myDB == null) {
71 // myDB = new Database();