All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.pojava.persistence.sql.package.html Maven / Gradle / Ivy

Go to download

POJava Persistence is a small library of tools used in the persistence and retrieval of data to and from storage, such as to a database or XML document. It contains an ORM (Object Relational Mapping) tool that supports use of existing beans and POJO's rather than requiring POJO's to be instrumented to support a tool.

The newest version!



    


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();




© 2015 - 2024 Weber Informatics LLC | Privacy Policy