com.triactive.jdo.store.mapping
Class ComplexMapping

java.lang.Object
  extended bycom.triactive.jdo.store.mapping.Mapping
      extended bycom.triactive.jdo.store.mapping.ComplexMapping
Direct Known Subclasses:
MapMapping, SetMapping

public abstract class ComplexMapping
extends Mapping

A database mapping that incorporates custom logic for object storage and retrieval.

Author:
Mike Martin

Field Summary
 
Fields inherited from class com.triactive.jdo.store.mapping.Mapping
dba, fmd, type
 
Constructor Summary
protected ComplexMapping(DatabaseAdapter dba, java.lang.Class type)
          Constructs a new complex mapping for a given Java type.
protected ComplexMapping(DatabaseAdapter dba, FieldMetaData fmd)
          Constructs a new complex mapping for a given persistent field.
 
Method Summary
abstract  void deleteObject(StateManager sm)
          Deletes an object from the database.
abstract  void deleteObjects(java.util.Collection sms)
          Deletes a collection of objects from the database.
abstract  java.lang.Object fetchObject(StateManager sm)
          Fetchs an object from the database.
abstract  void insertObject(StateManager sm, java.lang.Object value)
          Inserts an object in the database.
abstract  void updateObject(StateManager sm, java.lang.Object value)
          Updates an object in the database.
 
Methods inherited from class com.triactive.jdo.store.mapping.Mapping
accessAsFieldIn, defineConstraints, defineStorage, equals, getDefaultMappingsByType, getFieldMetaData, getType, hashCode, newSqlLiteral
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComplexMapping

protected ComplexMapping(DatabaseAdapter dba,
                         java.lang.Class type)
Constructs a new complex mapping for a given Java type.

Parameters:
dba - the database adapter
type - the Java class that this mapping maps to the database

ComplexMapping

protected ComplexMapping(DatabaseAdapter dba,
                         FieldMetaData fmd)
Constructs a new complex mapping for a given persistent field.

Parameters:
dba - the database adapter
fmd - the field metadata for the field that this mapping maps to the database
Method Detail

insertObject

public abstract void insertObject(StateManager sm,
                                  java.lang.Object value)
Inserts an object in the database.

Parameters:
sm - The state manager of the instance owning the Java object being inserted.
value - The object to insert.

fetchObject

public abstract java.lang.Object fetchObject(StateManager sm)
Fetchs an object from the database.

Parameters:
sm - The state manager of the instance owning the Java object being fetched.

updateObject

public abstract void updateObject(StateManager sm,
                                  java.lang.Object value)
Updates an object in the database.

Parameters:
sm - The state manager of the instance owning the Java object being updated.
value - The object to update.

deleteObject

public abstract void deleteObject(StateManager sm)
Deletes an object from the database.

Parameters:
sm - The state manager of the instance owning the Java object being deleted.

deleteObjects

public abstract void deleteObjects(java.util.Collection sms)
Deletes a collection of objects from the database. The specified collection cannot be empty.

Parameters:
sms - The state managers of the instances owning the Java objects being deleted. Must be non-empty.
Throws:
java.util.NoSuchElementException - if the specified collection is empty


Copyright © 2001-2007 The TJDO Project All Rights Reserved.