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

Quick Search    Search Deep

org.jdbf.engine.keygen
Class HighLowKeyGenerator  view HighLowKeyGenerator download HighLowKeyGenerator.java

java.lang.Object
  extended byorg.jdbf.engine.keygen.HighLowKeyGenerator
All Implemented Interfaces:
KeyGenerator

public class HighLowKeyGenerator
extends java.lang.Object
implements KeyGenerator

This is not the HighLow approach described by Scott Ambler in Mapping Objects To Relational Databases. Scott Ambler calls this the key-values approach, but others use "HighLow" to describe a modified key-values approach which does not use database access for each key.

Version:
$id$

Field Summary
private  java.util.Map keys
          Holds a KeyKeeper for each table.
 
Fields inherited from interface org.jdbf.engine.keygen.KeyGenerator
ONE
 
Constructor Summary
HighLowKeyGenerator()
           
 
Method Summary
 java.lang.Object generateKey(org.jdbf.engine.repository.RepositoryView view, java.sql.Connection conn, java.lang.String vendor)
          Returns a generated key.
 boolean isBeforeInsert()
          Generation of key is before insert.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keys

private java.util.Map keys
Holds a KeyKeeper for each table. The table's name is the key and the value is a KeyKeeper.

Constructor Detail

HighLowKeyGenerator

public HighLowKeyGenerator()
Method Detail

isBeforeInsert

public boolean isBeforeInsert()
Generation of key is before insert.

Specified by:
isBeforeInsert in interface KeyGenerator

generateKey

public java.lang.Object generateKey(org.jdbf.engine.repository.RepositoryView view,
                                    java.sql.Connection conn,
                                    java.lang.String vendor)
                             throws org.jdbf.engine.mapping.MappingException
Returns a generated key.

Specified by:
generateKey in interface KeyGenerator