KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > triactive > jdo > SchemaManagerFactory


1 /*
2  * Copyright 2002 (C) TJDO.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the TJDO License version 1.0.
6  * See the terms of the TJDO License in the documentation provided with this software.
7  *
8  * $Id: SchemaManagerFactory.java,v 1.2 2002/10/17 21:00:52 pierreg0 Exp $
9  */

10
11 package com.triactive.jdo;
12
13 import javax.jdo.JDOUserException;
14 import javax.jdo.PersistenceManager;
15
16 public class SchemaManagerFactory
17 {
18     private SchemaManagerFactory()
19     {
20     }
21
22     public static SchemaManager getSchemaManager(PersistenceManager pm)
23     {
24         if (pm instanceof com.triactive.jdo.PersistenceManagerImpl)
25             return ((com.triactive.jdo.PersistenceManagerImpl)pm).getStoreManager();
26
27         throw new JDOUserException("No schema manager available for this JDO implementation: " + pm.getClass().getName());
28     }
29 }
30
Popular Tags