[cvs]
expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj
MultiDBObjectTransaction.java
JCorporate Ltd
jcorp at jcorp2.servlets.net
Fri Sep 17 17:03:18 PDT 2004
Update of /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj
In directory jcorp2.servlets.net:/tmp/cvs-serv11981
Added Files:
MultiDBObjectTransaction.java
Log Message:
Yves Henri AMAIZO's contributions.
Commited by Raul Davidovich on 20040918
--- NEW FILE: MultiDBObjectTransaction.java ---
/* ====================================================================
* The Jcorporate Apache Style Software License, Version 1.2 05-07-2002
*
* Copyright (c) 1995-2002 Jcorporate Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by Jcorporate Ltd.
* (http://www.jcorporate.com/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. "Jcorporate" and product names such as "Expresso" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written permission,
* please contact info at jcorporate.com.
*
* 5. Products derived from this software may not be called "Expresso",
* or other Jcorporate product names; nor may "Expresso" or other
* Jcorporate product names appear in their name, without prior
* written permission of Jcorporate Ltd.
*
* 6. No product derived from this software may compete in the same
* market space, i.e. framework, without prior written permission
* of Jcorporate Ltd. For written permission, please contact
* partners at jcorporate.com.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL JCORPORATE LTD OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Jcorporate Ltd. Contributions back
* to the project(s) are encouraged when you make modifications.
* Please send them to support at jcorporate.com. For more information
* on Jcorporate Ltd. and its products, please see
* <http://www.jcorporate.com/>.
*
* Portions of this software are based upon other open source
* products and are subject to their respective licenses.
*/
package com.jcorporate.expresso.core.dbobj;
import com.jcorporate.expresso.core.db.DBConnection;
import com.jcorporate.expresso.core.db.DBException;
import org.apache.log4j.Logger;
/**
* A MultiDBObjectTransaction is a group of dbobjects that are "related" - e.g. defined
* as being part of a foreign-key/primary-key relationship. This may be
* master/detail or a more complex relationship, but it can be expressed as a
* "join" operation between the tables.
*
* After establishing the relationships between the objects the MultiDBObject
* can have search criteria set for it & searchAndRetrieve operations done just
* like a 'regular' DBObject, but these operations affect the entire related
* group of objects. At the moment, MultiDBObjects are read-only, though that
* may change in the future.
*
* Creation date: (10-12-2003 11:32:03 AM)
* author Yves Henri AMAIZO
*/
public class MultiDBObjectTransaction extends MultiDBObject {
private static final String thisClass = MultiDBObjectTransaction.class.getName() + ".";
private String dbName = null;
private static Logger log = Logger.getLogger(MultiDBObjectTransaction.class);
/**
* MultiDBObjectTransaction constructor comment.
*
* @throws DBException
*/
public MultiDBObjectTransaction()
throws DBException {
super();
} /* MultiDBObjectTransaction() */
/**
* Return the name of the context/database connection that this DB object is
* using. If none is set, then we are using the "default" database/context.
*
* @return the name of the datacontext
*/
public synchronized String getDBName() {
return super.getDBName();
} /* getDBName() */
/**
* Set the database name/context for this multi db object. If setDBName is not called,
* the "default" db name and context is used. See
* com.jcorporate.expresso.core.misc.ConfigManager for information about multiple
* contexts. Note that setting a db/context name only affects the object when it
* allocates it's own db connections - if a specific connection is used (via the
* setConnection(DBConnection) method) then that connection must be already
* associated with the correct db/context.
*
* @param newOther The name of the context or database to use
* @throws DBException
*/
public synchronized void setDBName(String newOther)
throws DBException {
super.setDBName(newOther) ;
} /* setDBName(String) */
/**
* @return
*/
public DBConnection getConnection() {
return localConnection;
}
/**
* @param connection
*/
public void setConnection(DBConnection connection) {
localConnection = connection;
}
} /* MultiDBObjectTransaction */
More information about the cvs
mailing list