Package org.pojava.persistence.sql

The sql package contains classes for providing ORM (Object Relational Model) functionality to POJava.

See:
          Description

Interface Summary
AdaptorMap<PROP,COL> AdaptorMap serves as a rules engine for determining which BindingAdaptor to use to translate data between a database field and a bean property.
ConnectionSource A connection source provides an interface allowing one to request a connection from a repository by a name.
Transaction This interface describes expected functionality from a Transaction object specific to JDBC.
 

Class Summary
AdaptorRegistry BindingAdaptors are registered by Method
DatabaseCache This singleton caches object properties that facilitate interchange between Java and external data stores.
DatabaseDriver Used to register a dynamically loaded JDBC driver in the system class loader.
DatabaseTransaction A DatabaseTransaction object coordinates the transactions of multiple connections so that all of them commit or roll back as a collective.
DataSourceMetadata This class keeps some useful information about a DataSource without holding open a Connection.
DefaultAdaptorMap<I,O> DefaultAdaptorMap is a rules engine for determining which BindingAdaptor to use to translate data between a database field and a bean property.
FieldMap<POJO,PROP,COL> A FieldMap maps an individual field of a database table to an individual bean property.
TableMap<POJO> TableMap manages a collection of mappings between a Java bean and a database table.
TransConnection This connection object provides a layer allowing a Transaction visibility to intervene (or interfere :) when a user of the connection performs transaction actions outside of those managed by the Transaction object itself.
 

Package org.pojava.persistence.sql Description

The sql package contains classes for providing ORM (Object Relational Model) functionality to POJava. A bean or POJO is mapped to a table or view in a database using a TableMap. Each field in that mapping is specified in a FieldMap. Finally, the transformations that occur in adapting field data from the Database to the POJO and back are managed by AdaptorMaps.

There is a DataSourceMetadata object for capturing MetaData about a database, and there is a DatabaseCache for quick access to a variety of data objects gathered.

There are also objects for coordinating transactions between multiple Connection objects. Collectively, these objects provide a very smooth and minimalistic means of handling the vast majority of database interactions.

Here's a brief (if impractical) example: DistributedTransaction trans=new DistributedTransaction(); List widgets=WidgetDao.listByQuery(trans, new WidgetQuery().forColor("purple")); for (Iterator it=widgets.iterator(); it.hasNext();) { Widget widget=(Widget) it.next(); Woozle woozle=new Woozle(widget.getId(), widget.getGizzard()); WoozleDao.updateInsert(trans, woozle); } trans.commit();



Copyright © 2011. All Rights Reserved.