Register for sign-in (non-invasive)
User Id Password
Provide feedback/Ask a question
Home Documentation Download Support Store

  Projects 
 Projects Overview 
  jWebApp  AGPLv3
 Description 
 Features 
  jPersist  GPLv3
 Description 
 Features 
  MemSL  GPLv3
 Description 
 C Features 
 C++ Features 
  Licensing 
 GPLv3 
 AGPLv3 
 O-S Exemption 
  Support 
 Support Agreements 
  News/Blog 
 jwaBlogger 
  Consulting 
 Consulting Services 


   OSI Certified Open Source jPersist - Java Database Persistence

Please donate via SourceForge.net
Please Support This Project
An equivalent donation also gets you access to
the documentation
(see Documentation)
Download from SourceForge.net  

Project at SourceForge.net
SourceForge.net Logo

 jPersist Description 

jPersist is an extremely powerful object-relational persistence API that is based on the Active-Record and Data-Mapper patterns.  jPersist wraps JDBC functionality and can work with any relational database, and any type of connection resource, including: java.sql.DriverManager, JNDI, javax.sql.DataSource, and third party connection pooling libraries (DBCP, C3PO, etc.). 

 

Using jPersist is as simple as:

 

    public void DatabaseExample(DatabaseManager dbm) throws JPersistException

      {

        // Inserting contact with associations

        Contact contact = new Contact("deisenhower", ...);

 

        contact.getSupport().add(new Support("Request", ...));

        contact.getSupport().add(new Support("Response", ...));

        contact.getSupport().add(new Support("Request", ...));

 

        contact.getOrders().add(new Order("Dwight D. Eisenhower Dollar", ...));

        contact.getOrders().add(new Order("Susan B. Anthony Dollar", ...));

 

        // Saving within an automatic transaction (covers all relationships)

        dbm.saveObject(contact);

 

        // Load based on information contained in classes

        contact = dbm.loadObject(Contact.class, "where :contactId like ?", “tjef%”);

        System.out.println("\ncontactId = " + contact.getContactId());

 

        // Load a collection of objects from the database

        Collection<Contact> c = dbm.loadObjects(new Vector<Contact>(), Contact.class);

 

        for (Contact contact2 : c)

          System.out.println("contactId = " + contact2.getContactId());

      }

 

All in all, jPersist’s sole reason for being is to provide simple trouble-free POJO oriented

access to your database. With jPersist and your POJOs, you should rarely have to

do anything more than:

 

·         Define a POJO (optionally extending jpersist.PersistentObject), which can be extended by other POJOs (relational hierarchy via joins).

·         Call one of jpersist.DatabaseManager’s: loadObject(), saveObject(), and deleteObject(), or one of jpersist.Database’s: saveObject(), deleteObject(), and queryObject() with jpersist.Result’s loadObject().

·         Group saves and deletes in a transaction using jpersist.TransactionManager or use jpersist.Database’s transaction oriented methods.

·         Group updates in an update manager using jpersist.UpdateManager or use jpersist.Database’s update and batch oriented methods.

 

That’s not to say you won’t have other JDBC needs, like calling stored procedures or executing SQL statements, but with jPersist it’s all easy to handle.

 

Powered By

Powered by jWebApp
and
jpersist (3K)


 Notice 

Copyright (C) 2002 - present, David Bulmore/Software Sensation Inc. ALL RIGHTS RESERVED.

Software Sensation, jWebApp, jPersist, Install&Update, Enterprise Server Objects (ESO), Enterprise Server Scripting (ESS), and Memory Structures Library (MemSL) are trademarks or registered trademarks of Software Sensation, Inc. in the U.S. and other countries.

Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.