Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 85876 invoked from network); 3 Feb 2004 11:12:21 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 3 Feb 2004 11:12:21 -0000 Received: (qmail 53830 invoked by uid 500); 3 Feb 2004 11:11:42 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 53533 invoked by uid 500); 3 Feb 2004 11:11:40 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 53479 invoked by uid 500); 3 Feb 2004 11:11:39 -0000 Delivered-To: apmail-cocoon-2.1-cvs@apache.org Received: (qmail 53456 invoked from network); 3 Feb 2004 11:11:39 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 3 Feb 2004 11:11:39 -0000 Received: (qmail 85618 invoked by uid 1746); 3 Feb 2004 11:12:05 -0000 Date: 3 Feb 2004 11:12:05 -0000 Message-ID: <20040203111205.85617.qmail@minotaur.apache.org> From: antonio@apache.org To: cocoon-2.1-cvs@apache.org Subject: cvs commit: cocoon-2.1/src/blocks/ojb/java/org/apache/cocoon/ojb samples.jdo X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N antonio 2004/02/03 03:12:05 Modified: tools/src blocks-build.xsl Added: src/blocks/ojb build.xml src/blocks/ojb/conf/java Department.java Employee.java src/blocks/ojb/conf OJB.properties package.jdo repository.dtd repository.xml EmployeeImpl.java src/blocks/ojb/lib db-ojb-1.0.rc5-20040203.jar Removed: src/blocks/ojb/WEB-INF/classes/org/apache/cocoon/ojb/samples Employee.class Department.class src/blocks/ojb/lib db-ojb-1.0.rc5-20040125.jar src/blocks/ojb/java/org/apache/cocoon/ojb/samples EmployeeImpl.java Department.java jdo.dtd Employee.java src/blocks/ojb/WEB-INF/classes/org/apache/cocoon/ojb jdo.dtd samples.jdo src/blocks/ojb/WEB-INF/classes OJB.properties repository.dtd repository.xml src/blocks/ojb/java/org/apache/cocoon/ojb samples.jdo Log: Fixing OJB-JDO samples. No more precompiled classes needed. JDO Enhancer now run at compiler time. It run only if jdo jars is present at compiled time to avoid breaking the build. Revision Changes Path 1.1 cocoon-2.1/src/blocks/ojb/build.xml Index: build.xml =================================================================== Running JDO Enhancer because ${jdo.present} ... 1.1 cocoon-2.1/src/blocks/ojb/conf/java/Department.java Index: Department.java =================================================================== /* ============================================================================ The Apache Software License, Version 1.1 ============================================================================ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modifica- tion, 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 the Apache Software Foundation (http://www.apache.org/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. 4. The names "Apache Cocoon" and "Apache Software Foundation" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact apache@apache.org. 5. Products derived from this software may not be called "Apache", nor may "Apache" appear in their name, without prior written permission of the Apache Software Foundation. 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 THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- DING, 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 Apache Software Foundation and was originally created by Stefano Mazzocchi . For more information on the Apache Software Foundation, please see . */ package org.apache.cocoon.ojb.samples; import java.io.Serializable; /** * Department's Bean * * @author Antonio Gallardo * @version CVS $Id: Department.java,v 1.1 2004/02/03 11:12:04 antonio Exp $ */ public class Department implements Serializable { private int id; protected String name; public Department(){ } public int getId() { return id; } public String getName() { return name; } public void setId(int newId) { id = newId; } public void setName(String newName) { name = newName; } } 1.1 cocoon-2.1/src/blocks/ojb/conf/java/Employee.java Index: Employee.java =================================================================== /* ============================================================================ The Apache Software License, Version 1.1 ============================================================================ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modifica- tion, 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 the Apache Software Foundation (http://www.apache.org/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. 4. The names "Apache Cocoon" and "Apache Software Foundation" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact apache@apache.org. 5. Products derived from this software may not be called "Apache", nor may "Apache" appear in their name, without prior written permission of the Apache Software Foundation. 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 THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- DING, 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 Apache Software Foundation and was originally created by Stefano Mazzocchi . For more information on the Apache Software Foundation, please see . */ package org.apache.cocoon.ojb.samples; import java.io.Serializable; /** * Employee's Bean * * @author Antonio Gallardo * @version CVS $Id: Employee.java,v 1.1 2004/02/03 11:12:04 antonio Exp $ */ public class Employee implements Serializable { private int id; protected int departmentId; protected String name; public Employee(){ this.id = 1; this.departmentId = 1; this.name = "My Name"; } public int getId() { return this.id; } public int getDepartmentId() { return this.departmentId; } public String getName() { return this.name; } public void setId(int newId) { this.id = newId; } public void setDepartmentId(int newDepartmentId) { this.departmentId = newDepartmentId; } public void setName(String newName) { this.name = newName; } } 1.1 cocoon-2.1/src/blocks/ojb/conf/OJB.properties Index: OJB.properties =================================================================== # OJB.properties -- configuration of the OJB runtime environment # Version: 1.0 # (c) 2001, 2002, 2003 Apache Software Foundation # Author: Thomas Mahler and many others # @version $Id: OJB.properties,v 1.1 2004/02/03 11:12:04 antonio Exp $ # #---------------------------------------------------------------------------------------- # repository file settings #---------------------------------------------------------------------------------------- # The repositoryFile entry tells OJB to use this file as as its standard mapping # repository. The file is looked up from the classpath. # repositoryFile=repository.xml # # If the useSerializedRepository entry is set to true, OJB tries to load a # serialized version of the repository for performance reasons. # if set to false, OJB always loads the xml file. # Setting this flag to true will accelerate the startup sequence of OJB. # If set to true changes to the repository.xml file will only be detected # after maually deleting the repository.xml.serialized file. useSerializedRepository=false # # If Repository serialization is used the entry serializedRepositoryPath defines the # directory where the Repository is written to and read from. # this entry is used only when the useSerializedRepository flag is set to true # serializedRepositoryPath=. # #---------------------------------------------------------------------------------------- # PersistenceBrokerFactory / PersistenceBroker #---------------------------------------------------------------------------------------- # The PersistenceBrokerFactoryClass entry decides which concrete # PersistenceBrokerFactory implemention is to be used. PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl # # The PersistenceBrokerClass entry decides which concrete PersistenceBroker # implementation is to be served by the PersistenceBrokerFactory. # This is the singlevm implementation: PersistenceBrokerClass=org.apache.ojb.broker.core.PersistenceBrokerImpl # # This is an implementation that uses Prevayler (prevayler.sf.net) as the persistent storage. # Using this implementation OJB works as a simple OODBMS #PersistenceBrokerClass=org.apache.ojb.broker.prevayler.PBPrevaylerImpl # # #---------------------------------------------------------------------------------------- # PersistenceBrokerFactory pool #---------------------------------------------------------------------------------------- # PersistenceBroker pool configuration # This pool uses the jakarta-commons-pool api. # There you can find things described in detail. # # maximum number of brokers that can be borrowed from the # pool at one time. When non-positive, there is no limit. maxActive=100 # # controls the maximum number of brokers that can sit idle in the # pool (per key) at any time. When non-positive, there is no limit maxIdle=-1 # # max time block to get broker instance from pool, after that exception is thrown. # When non-positive, block till last judgement maxWait=2000 # # indicates how long the eviction thread should sleep before "runs" of examining # idle objects. When non-positive, no eviction thread will be launched. timeBetweenEvictionRunsMillis=-1 # # specifies the minimum amount of time that an broker may sit idle # in the pool before it is eligable for eviction due to idle time. # When non-positive, no object will be dropped from the pool due # to idle time alone (depends on timeBetweenEvictionRunsMillis > 0) minEvictableIdleTimeMillis=1000000 # # specifies the behaviour of the pool when broker capacity is # exhausted (see maxActive above) # 0 - fail # 1 - block # 2 - grow whenExhaustedAction=0 # # #---------------------------------------------------------------------------------------- # ConnectionFactory / Default ConnectionPool #---------------------------------------------------------------------------------------- # The ConnectionFactoryClass entry determines which kind of ConnectionFactory # is to be used within org.apache.ojb as connection factory. # A ConnectionFactory is responsible for creating # JDBC Connections. Current version ships four implementations: # # 1. ConnectionFactoryAvalonDatasource # Uses a Cocoon configured DataSource specified with the jcd-alias attribute value in # a jdbc-connection-descriptor element in the repository.xml file. # 2. ConnectionFactoryNotPooledImpl # No pooling, no playing around. # Every connection request returns a new connection, # every connection release close the connection. # 3. ConnectionFactoryPooledImpl # This implementation supports connection pooling. # 4. ConnectionFactoryDBCPImpl # Using the jakarta-DBCP api for connection management, support # connection- and prepared statement-pooling, abandoned connection handling. # 5. ConnectionFactoryManagedImpl # Connection factory for use within managed environments - e.g. JBoss. # Every obtained DataSource was wrapped within OJB (and ignore # e.g. con.commit() calls within OJB). # Use this implementation e.g if you use Datasources from an application server. # # Use the OJB performance tests to decide, which implementation is best for you. # The proper way of obtaining a connection is configured in # JDBCConnectionDescriptor entries in the repository.xml file. # If want a more fine grained control of each connection pool used by OJB, # take a look at the repository.dtd, there was a possibility to override # this default connection factory entry in each JDBCConnectionDescriptor. # ConnectionFactoryClass=org.apache.cocoon.ojb.components.ConnectionFactoryAvalonDataSource #ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl #ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryNotPooledImpl #ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl #ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl # # #---------------------------------------------------------------------------------------- # ConnectionManager #---------------------------------------------------------------------------------------- # The ConnectionManagerClass entry defines the ConnectionManager implemementation to be used ConnectionManagerClass=org.apache.ojb.broker.accesslayer.ConnectionManagerImpl # # #---------------------------------------------------------------------------------------- # SqlGenerator #---------------------------------------------------------------------------------------- # The SqlGeneratorClass entry defines the SqlGenerator implemementation to be used SqlGeneratorClass=org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl # # #---------------------------------------------------------------------------------------- # CollectionProxy class #---------------------------------------------------------------------------------------- # The optional CollectionProxy entry defines the class to be used for CollectionProxies # if this entry is null org.apache.ojb.broker.accesslayer.ListProxy is used for Lists # and org.apache.ojb.broker.accesslayer.CollectionProxy for Collections # #CollectionProxyClass= # #---------------------------------------------------------------------------------------- # StatementManager #---------------------------------------------------------------------------------------- # The StatementManagerClass entry defines the StatementManager implemementation to be used StatementManagerClass=org.apache.ojb.broker.accesslayer.StatementManager # # #---------------------------------------------------------------------------------------- # StatementsForClass #---------------------------------------------------------------------------------------- # The StatementsForClassClass entry defines the StatementsForClass implemementation to be used # to implement cached statements. StatementsForClassClass=org.apache.ojb.broker.accesslayer.StatementsForClassImpl # # #---------------------------------------------------------------------------------------- # JdbcAccess #---------------------------------------------------------------------------------------- # The JdbcAccessClass entry defines the JdbcAccess implemementation to be used JdbcAccessClass=org.apache.ojb.broker.accesslayer.JdbcAccessImpl # # #---------------------------------------------------------------------------------------- # Object cache #---------------------------------------------------------------------------------------- # The ObjectCacheClass entry tells OJB which concrete ObjectCache # implementation is to be used as standard cache. # Its also possible to override this entry adding object-cache elements # on jdbc-connection-descriptor level and # per class-descriptor in repository file. More info see documentation. # ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheDefaultImpl #ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheEmptyImpl #ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCachePerBrokerImpl #ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheJCSPerClassImpl #ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCachePerClassImpl # # # This property is only relevant if the per class-descriptor object-cache # declaration was used in conjunction with metadata runtime changes. # If set 'flase' the class name of the object is used # to find a per class ObjectCache implementation. # If set 'true' the ObjectCacheDescriptor instance is used as key to # find a per class ObjectCache, this enables to use different ObjectCache # instances for the same class. descriptorBasedCaches=false # # # Use CacheFilters to do filter operations before caching methods were # called. Build your own filter class by implementing org.apache.ojb.cache.CacheFilter. # It is possible to use a arbitrary number of CacheFilters, but this slows # down the performance of the cache, thus handle with care. # # - org.apache.ojb.broker.cache.CacheFilterClassImpl # allows filtering of classes # - org.apache.ojb.broker.cache.CacheFilterPackageImpl # allows filtering of packages # More info see Javadoc of the according classes. # Set a comma separated list of CacheFilter. #ObjectCacheFilter=org.apache.ojb.broker.cache.CacheFilterClassImpl,org.apache.ojb.broker.cache.CacheFilterPackageImpl # #---------------------------------------------------------------------------------------- # Locking #---------------------------------------------------------------------------------------- # The LockManagerClass entry tells OJB which concrete LockManager # implementation is to be used. LockManagerClass=org.apache.ojb.odmg.locking.LockManagerDefaultImpl # # The LockMapClass entry tells OJB which concrete LockMap # implementation is to be used. # If OJB is running on multiple concurrent clients it is recommended # to use the PersistentLockMapImpl. It guarantees to provide # Lockamanagement across multiple JVMs. # If OJB is running in a single JVM (e.g. in a desktop app, or in a servlet # engine) it is save to use the InMemoryLockMapImpl. Using it will result # in a large performance gain. # LockMapClass=org.apache.ojb.odmg.locking.PersistentLockMapImpl LockMapClass=org.apache.ojb.odmg.locking.InMemoryLockMapImpl # # The LockTimeout entry defines the maximum time in milliseconds # that a lock may be hold. Defaults to 60000 = 1 minute LockTimeout=60000 # # The ImplicitLocking entry defines if implicit lock acquisition is # to be used. If set to true OJB implicitely locks objects to ODMG # transactions after performing OQL queries. # If implicit locking is used locking objects is recursive, that is # associated objects are also locked. # If ImplicitLocking is set to false, no locks are obtained in OQL # queries and there is also no recursive locking. ImplicitLocking=true #ImplicitLocking=false # # The LockAssociations entry defines the behaviour for the OJB # implicit locking feature. If set to WRITE (default) acquiring a write- # lock on a given object x implies write locks on all objects associated # to x. If set to READ implicit read-locks are acquired. # Acquiring a read-lock on x thus allways results in implicit read-locks # on all associated objects. #LockAssociations=READ LockAssociations=WRITE # # #---------------------------------------------------------------------------------------- # Logging #---------------------------------------------------------------------------------------- # The LoggerClass entry tells OJB which concrete Logger # implementation is to be used. # # Commons-logging #LoggerClass=org.apache.ojb.broker.util.logging.CommonsLoggerImpl # log4j based logging #LoggerClass=org.apache.ojb.broker.util.logging.Log4jLoggerImpl # OJB's own simple looging support LoggerClass=org.apache.ojb.broker.util.logging.PoorMansLoggerImpl LoggerConfigFile=log4j.properties # # The LogLevel entries tells OJB which LogLevels are active # for the different loggers used within OJB # Loglevels: DEBUG < INFO < WARN < ERROR < FATAL # That is loglevel WARN won't log DEBUG and INFO messages, # but will log WARN, ERROR, and FATAL messages # # Global default log level used for all logging # entities if not specified ROOT.LogLevel=ERROR # # The Default Logger instance used within OJB DEFAULT.LogLevel=WARN # Logger for PersistenceBrokerImpl class org.apache.ojb.broker.core.PersistenceBrokerImpl.LogLevel=WARN # Logger for PersistenceBrokerFactory class PersistenceBrokerFactoryDefaultImpl org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.LogLevel=WARN # Logger for RepositoryXmlHandler, useful for debugging parsing of repository.xml! org.apache.ojb.broker.metadata.RepositoryXmlHandler.LogLevel=WARN # Logger for JdbcAccess, useful for debugging JDBC related problems org.apache.ojb.broker.accesslayer.JdbcAccessImpl.LogLevel=WARN # Logger for RsIterator, useful for debugging problems with Object materialization org.apache.ojb.broker.accesslayer.RsIterator.LogLevel=WARN # Logger for StatementsForClass, useful for debugging JDBC Connection related problems org.apache.ojb.broker.accesslayer.StatementsForClassImpl.LogLevel=WARN # Logger for SqlGenerator, useful for debugging generation of SQL org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl.LogLevel=WARN # Logger for RepositoryPersistor org.apache.ojb.broker.metadata.RepositoryPersistor.LogLevel=WARN # Logger for ConnectionFactory base class org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.LogLevel=WARN # Logger for ConnectionManager org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.LogLevel=WARN # # Special Logger categories used in test suite and tutorials # # Logger for the ODMG Implementation ODMG.LogLevel=WARN # Logger for the JDO RI Implementation JDO.LogLevel=DEBUG # Logger for the performance tests performance.LogLevel=INFO # Logger for the soda api soda.LogLevel=WARN # Logger for the factory service ConfigurableFactory.LogLevel=WARN # # #---------------------------------------------------------------------------------------- # OQL / SQL settings #---------------------------------------------------------------------------------------- # The OqlCollectionClass entry defines the collection type returned # from OQL queries. By default this value is set to DListImpl. # This will be good for most situations as DList allows maximum flexibility # in a ODMG environment. See also section 'ODMG settings'. # Using DLists for large resultsets may be bad for application performance. # For these scenarios you can use ArrayLists or Vectors. # Important note: the collections class to be used MUST implement the # interface org.apache.ojb.broker.ManageableCollection. # OqlCollectionClass=org.apache.ojb.odmg.collections.DListImpl_2 # OqlCollectionClass=org.apache.ojb.broker.util.collections.ManageableArrayList # OqlCollectionClass=org.apache.ojb.broker.util.ManageableVector # # The SqlInLimit entry limits the number of values in IN-sql statement, # -1 for no limits. This hint is used in Criteria. SqlInLimit=200 # # #---------------------------------------------------------------------------------------- # ODMG settings #---------------------------------------------------------------------------------------- # Used ODMG collection implementation classes # (e.g. when do a Implementation#newDlist() call) # # org.odmg.DList implementation class DListClass=org.apache.ojb.odmg.collections.DListImpl_2 #DListClass=org.apache.ojb.odmg.collections.DListImpl # # org.odmg.DArray implementation class DArrayClass=org.apache.ojb.odmg.collections.DListImpl_2 #DArrayClass=org.apache.ojb.odmg.collections.DListImpl # # org.odmg.DMap implementation class DMapClass=org.apache.ojb.odmg.collections.DMapImpl # # org.odmg.DBag implementation class DBagClass=org.apache.ojb.odmg.collections.DBagImpl # # org.odmg.DSet implementation class DSetClass=org.apache.ojb.odmg.collections.DSetImpl # # #---------------------------------------------------------------------------------------- # Meta data / mapping settings #---------------------------------------------------------------------------------------- # The PersistentFieldClass property defines the implementation class # for PersistentField attributes used in the OJB MetaData layer. # By default the best performing attribute/refection based implementation # is selected (PersistentFieldDirectAccessImpl). # # - PersistentFieldDirectAccessImpl # is a high-speed version of the access strategies. # It does not cooperate with an AccessController, # but accesses the fields directly. Persistent # attributes don't need getters and setters # and don't have to be declared public or protected # - PersistentFieldPrivilegedImpl # Same as above, but does cooperate with AccessController and do not # suppress the java language access check. # - PersistentFieldIntrospectorImpl # uses JavaBeans compliant calls only to access persistent attributes. # No Reflection is needed. But for each attribute xxx there must be # public getXxx() and setXxx() methods. # - PersistentFieldDynaBeanAccessImpl # implementation used to access a property from a # org.apache.commons.beanutils.DynaBean. # PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImpl #PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldPrivilegedImpl #PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldIntrospectorImpl #PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDynaBeanAccessImpl # # #---------------------------------------------------------------------------------------- # Component Intercepting for Profiling and Tracing #---------------------------------------------------------------------------------------- # By enabling an InterceptorClass all OJB components will use # this Interceptor. Interceptors allow advanced tracing and Profiling # of all component method calls. # This is currently an experimental feature useful only for OJB kernel developers. # #InterceptorClass=org.apache.ojb.broker.util.interceptor.TracingInterceptor # #---------------------------------------------------------------------------------------- # Transaction Management and assocation #---------------------------------------------------------------------------------------- # Use the LocalTxManager if you want the transaction to be associated by a thread OJBTxManagerClass=org.apache.ojb.odmg.LocalTxManager # Use the JTATxManager if you want the transaction to be associated via the Transaction # manager that is in your application server. #OJBTxManagerClass=org.apache.ojb.odmg.JTATxManager # # The TransactionManager is acquired in different ways dependent on the application server. # The JTATransactionManagerClass property allows you to specify the class that implements # the proper behaviour for finding the transaction manager. Only use when OJBTxManagerClass # is set to a factory that uses the application server transaction manager # (org.apache.ojb.odmg.JTATxManager) # # JBoss Transaction Manager Factory JTATransactionManagerClass=org.apache.ojb.odmg.transaction.JBossTransactionManagerFactory # Weblogic Transaction Manager Factory #JTATransactionManagerClass=org.apache.ojb.odmg.transaction.WeblogicTransactionManagerFactory # WebSphere transaction manager factory #JTATransactionManagerClass=org.apache.ojb.odmg.transaction.WebSphereTransactionManagerFactory # Orion transaction manager factory #JTATransactionManagerClass=org.apache.ojb.odmg.transaction.OrionTransactionManagerFactory # #---------------------------------------------------------------------------------------- # End of OJB.properties file #---------------------------------------------------------------------------------------- 1.1 cocoon-2.1/src/blocks/ojb/conf/package.jdo Index: package.jdo =================================================================== 1.1 cocoon-2.1/src/blocks/ojb/conf/repository.dtd Index: repository.dtd =================================================================== 1.1 cocoon-2.1/src/blocks/ojb/conf/repository.xml Index: repository.xml =================================================================== 1.1 cocoon-2.1/src/blocks/ojb/conf/EmployeeImpl.java Index: EmployeeImpl.java =================================================================== /* ============================================================================ The Apache Software License, Version 1.1 ============================================================================ Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modifica- tion, 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 the Apache Software Foundation (http://www.apache.org/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. 4. The names "Apache Cocoon" and "Apache Software Foundation" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact apache@apache.org. 5. Products derived from this software may not be called "Apache", nor may "Apache" appear in their name, without prior written permission of the Apache Software Foundation. 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 THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- DING, 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 Apache Software Foundation and was originally created by Stefano Mazzocchi . For more information on the Apache Software Foundation, please see . */ package org.apache.cocoon.ojb.samples; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.cocoon.ojb.jdo.components.JdoPMF; import org.apache.ojb.broker.Identity; import org.apache.ojb.broker.PersistenceBroker; import org.apache.ojb.broker.PersistenceBrokerFactory; /** * Employee's Impl * * @author Antonio Gallardo * @version CVS $Id: EmployeeImpl.java,v 1.1 2004/02/03 11:12:04 antonio Exp $ */ public class EmployeeImpl { public EmployeeImpl(){} public void retrieve(Employee bean, JdoPMF pmf) { /* 1. Get the PersistenceManager */ PersistenceManager persistenceManager = pmf.getPersistenceManager(); Employee e = new Employee(); e.setId(bean.getId()); PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker(); Identity oid = new Identity(e, broker); Employee b = new Employee(); // 2. start transaction persistenceManager.currentTransaction().begin(); // 3. Get the Object based on the primary key b = (Employee) persistenceManager.getObjectById(oid, false); // 4. Copy data to bean copyData(b, bean); // 5. End transaction persistenceManager.currentTransaction().commit(); } public void insert(Employee e, JdoPMF pmf) { /* 1. Get the PersistenceManager */ PersistenceManager persistenceManager = pmf.getPersistenceManager(); // 2. Get current transaction Transaction tx = persistenceManager.currentTransaction(); // 3. Start a Transaction tx.begin(); // 4. now perform persistence operations. Store the Employee persistenceManager.makePersistent(e); // 5. Commit the transaction tx.commit(); } public void update(Employee bean, JdoPMF pmf) { /* 1. Get the PersistenceManager */ PersistenceManager persistenceManager = pmf.getPersistenceManager(); Employee e = new Employee(); e.setId(bean.getId()); PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker(); Identity oid = new Identity(e, broker); Employee b = new Employee(); // 2. start transaction persistenceManager.currentTransaction().begin(); // 3. Get the Object based on the primary key b = (Employee) persistenceManager.getObjectById(oid, false); // 4. Copy data from bean copyData(bean, b); // Store to database // persistenceManager.makePersistent(b); // 5. End transaction persistenceManager.currentTransaction().commit(); } public void remove(Employee bean, JdoPMF pmf) { /* 1. Get the PersistenceManager */ PersistenceManager persistenceManager = pmf.getPersistenceManager(); Employee e = new Employee(); e.setId(bean.getId()); PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker(); Identity oid = new Identity(e, broker); Employee b = new Employee(); // 2. start transaction persistenceManager.currentTransaction().begin(); // 3. Get the Object based on the primary key b = (Employee) persistenceManager.getObjectById(oid, false); // Delete in the database persistenceManager.deletePersistent(b); // 5. End transaction persistenceManager.currentTransaction().commit(); } private void copyData(Employee from, Employee to) { to.setId(from.getId()); to.setDepartmentId(from.getDepartmentId()); to.setName(from.getName()); } } 1.1 cocoon-2.1/src/blocks/ojb/lib/db-ojb-1.0.rc5-20040203.jar <> 1.45 +1 -0 cocoon-2.1/tools/src/blocks-build.xsl Index: blocks-build.xsl =================================================================== RCS file: /home/cvs//cocoon-2.1/tools/src/blocks-build.xsl,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- blocks-build.xsl 1 Jan 2004 22:43:29 -0000 1.44 +++ blocks-build.xsl 3 Feb 2004 11:12:05 -0000 1.45 @@ -27,6 +27,7 @@ +