cleanup
[cdmlib.git] / cdmlib-persistence / src / main / java / eu / etaxonomy / cdm / persistence / hibernate / TableGeneratorGlobalOverride.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9 package eu.etaxonomy.cdm.persistence.hibernate;
10
11 import java.util.Properties;
12
13 import org.springframework.stereotype.Component;
14
15 /**
16 * This class allows to globally override id generation settings in hibernate
17 *
18 * @see: eu.etaxonomy.cdm.persistence.hibernate.TableGenerator
19 *
20 * @author a.kohlbecker
21 * @since Feb 23, 2016
22 *
23 */
24 //TODO this class has been moved to cdmlib-persistence preliminarily. It should be moved to
25 //cdmlib-test again as it should be used only in test. Currently this is not possible because
26 //sessionFactory bean has a dependsOn relationship to this class and this creates problems in remote-webapp
27 //as the been is not available
28 //see also TableGenerator
29 @Component
30 class TableGeneratorGlobalOverride {
31
32 public TableGeneratorGlobalOverride(){}
33
34 // public static final ThreadLocal<Properties> threadLocalProperties = new ThreadLocal<>();
35
36 public static Properties properties;
37
38 public static Properties getProperties() {
39 // return threadLocalProperties.get();
40 return TableGeneratorGlobalOverride.properties;
41 }
42
43 public void setProperties(Properties properties) {
44 // threadLocalProperties.set(properties);
45 TableGeneratorGlobalOverride.properties = properties;
46 }
47
48 }