<classpathentry kind="lib" path="war/WEB-INF/lib/spring-web.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/aopalliance.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/commons-lang-2.4.jar"/>
+ <classpathentry kind="lib" path="war/WEB-INF/lib/spring-orm.jar"/>
<classpathentry kind="output" path="war/WEB-INF/classes"/>
</classpath>
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-*/
-
+ */
package jp.sourceforge.rabbitBTS;
-import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManagerFactory;
public final class PMF {
- private static final PersistenceManagerFactory pmfInstance = JDOHelper
- .getPersistenceManagerFactory("transactions-optional");
+ // private static final PersistenceManagerFactory pmfInstance = JDOHelper
+ // .getPersistenceManagerFactory("transactions-optional");
private PMF() {
};
public static PersistenceManagerFactory get() {
- return pmfInstance;
+ return PMFSupport.getPmf();
}
}
--- /dev/null
+/*
+ Copyright 2009 senju@users.sourceforge.jp
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+
+package jp.sourceforge.rabbitBTS;
+
+import javax.jdo.PersistenceManagerFactory;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * 一時的に実装するクラス。
+ *
+ * TODO:DAO化が完了したら削除されるべき
+ */
+public class PMFSupport {
+ private static PersistenceManagerFactory pmf;
+
+ /**
+ * @return the pmf
+ */
+ public static PersistenceManagerFactory getPmf() {
+ return pmf;
+ }
+
+ /**
+ * @param pmf
+ * the pmf to set
+ */
+ @Autowired
+ public void setPmf(PersistenceManagerFactory pmf) {
+ PMFSupport.pmf = pmf;
+ }
+
+}
<property name="mappedName"> <value>index</value> </property> </bean>
-->
+ <!-- DAO -->
+ <bean id="persistenceManagerFactory"
+ class="org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean">
+ <property name="persistenceManagerFactoryName" value="transactions-optional" />
+ </bean>
+
+ <bean class="jp.sourceforge.rabbitBTS.PMFSupport" />
+
</beans>