Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.enableit.db.daf
Interface DataAbstractionFacade  view DataAbstractionFacade download DataAbstractionFacade.java


public interface DataAbstractionFacade

Abstraction interface for various data persistence technologies. As such this interface and its implementations are supposed to be thin wrappers over one of the various data persistence options (e.g. JDBC, Entity EJB, JDO etc...), not an alternative in their own right or an implementation of one of these technologes.
This allows UI applications to be written in a persistence impartial manner. That may sound similar to the purpose of the Sun JDO spec, but it is different because this toolkit is intended to be part of an application architecture, not part of the infrastructure. In this way it is hoped that this interface can protect application developers from the evolution of Java technologies. As new infrastructure technologies and optimisations become available from Sun and other infrastructure vendors they can be 'plugged in' by implementing this interface.
The other main purpose is to allow applications to be rapidly configured to the most appropriate persistence technology in a declarative manner (i.e. without code changes). For example a small web-application with direct JDBC persistence may 'scale-up' to Entity EJB data persistence simply by configuration of the data-abstraction.xml file.
Implementations of this interface have responsibility for encoding the data for the appropriate data store, but are not required to validate that data. This is the responsibility of application business objects of generic UI services such as the Struts validator.


Method Summary
 java.lang.Object create(java.lang.Object bean)
           
 boolean exists(java.lang.Object bean)
          Test if the bean exists in the configured data store.
 java.lang.Object load(java.lang.Object bean)
           
 java.lang.Object modify(java.lang.Object bean)
           
 java.lang.Object remove(java.lang.Object bean)
           
 

Method Detail

exists

public boolean exists(java.lang.Object bean)
               throws QueryException
Test if the bean exists in the configured data store.

If the bean implements org.enableit.db.daf.ComparableBean then the Persistent datastore will be queried for an entry that matches just those properties defined by the getEqualityPropertyList. Otherwise every accessible property will be used in the query.


create

public java.lang.Object create(java.lang.Object bean)
                        throws NotPersistedException

modify

public java.lang.Object modify(java.lang.Object bean)
                        throws NotPersistedException

remove

public java.lang.Object remove(java.lang.Object bean)
                        throws NotPersistedException

load

public java.lang.Object load(java.lang.Object bean)
                      throws QueryException