📄 odmg.java
字号:
// You can redistribute this software and/or modify it under the terms of// the Ozone Library License version 1 published by ozone-db.org.//// The original code and portions created by SMB are// Copyright (C) 1997-2000 by SMB GmbH. All rights reserved.//// $Id: ODMG.java,v 1.4 2000/10/28 16:55:19 daniela Exp $package org.ozoneDB.odmg;import java.io.*;import org.odmg.*;import org.ozoneDB.DxLib.*;/** * This abstract class enhances the original ODMG {@link Implementation} interface * by a standard way to obtain the database of a given object. The newly * introduced static method allows to obtain the database for a given object * without the need to know the actual {@link Implementation} factory object. This * is particularly useful for ozone, where database object do not have access to * the client side logic and variables.<p> * * {@link OzoneODMG} does already implement this interface. Wrappers for other * ODMG database systems just need to make sure to call the default ctor of the * underlying class. * * * @author <a href="http://www.softwarebuero.de/">SMB</a> @version * $Revision: 1.4 $Date: 2000/10/28 16:55:19 $ */public abstract class ODMG implements Implementation { private static DxBag factories; private static EnhDatabase theServerSideODMGDatabase; static { // are we inside the server... if (org.ozoneDB.core.Env.currentEnv() != null) { theServerSideODMGDatabase = new OzoneServerODMGDatabase(); } else { // ...or inside the client factories = new DxArrayBag(); } } public static Database getDatabase2( Object obj ) { // are we inside the server... if (theServerSideODMGDatabase != null) { return theServerSideODMGDatabase; } else { // ...or inside the client ODMG odmg = null; DxIterator it = factories.iterator(); while ((odmg = (ODMG)it.next()) != null) { Database db = odmg.getDatabase( obj ); if (db != null) { return db; } } return null; } } public ODMG() { factories.add( this ); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -