org.javagen.agile.db.visitor
Class AutoIncrementFinderVisitor

java.lang.Object
  extended by org.javagen.agile.db.visitor.DefaultDatabaseVisitor
      extended by org.javagen.agile.db.visitor.AutoIncrementFinderVisitor
All Implemented Interfaces:
Generator, Visit, Visitor, DatabaseVisitor

public class AutoIncrementFinderVisitor
extends DefaultDatabaseVisitor

Sets all non-composite, unique primary keys matching the SQL types specified by the targetAutoPkTypes Set to auto-incrament primary keys. Wire this class into the code generation pipeline after database model creation, but before Java conversion.

Author:
Richard Easterling

Field Summary
static EnumSet<DbType> DEFAULT_AUTO_PK_TYPES
           
static Set<String> ITINERARY
           
 
Fields inherited from class org.javagen.agile.db.visitor.DefaultDatabaseVisitor
itinerary, relativeInputPath
 
Fields inherited from interface org.javagen.agile.db.visitor.DatabaseVisitor
ALL_MODEL_TYPES, FK_ONLY_MODEL_TYPES, NON_FK_MODEL_TYPES
 
Constructor Summary
AutoIncrementFinderVisitor()
           
 
Method Summary
 EnumSet<DbType> getTargetAutoPkTypes()
           
 Set<String> itinerary()
          A way to limit node traversal to a subset of model instances.
 void setTargetAutoPkTypes(EnumSet<DbType> targetAutoPkTypes)
          set to null to match all unique primary keys
 void visit(PkColumn pkColumn)
          Identify and set auto-increment primary keys using specified pattern.
 
Methods inherited from class org.javagen.agile.db.visitor.DefaultDatabaseVisitor
gen, getRelativeInputPath, setItinerary, setItinerary, setRelativeInputPath, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_AUTO_PK_TYPES

public static final EnumSet<DbType> DEFAULT_AUTO_PK_TYPES

ITINERARY

public static final Set<String> ITINERARY
Constructor Detail

AutoIncrementFinderVisitor

public AutoIncrementFinderVisitor()
Method Detail

getTargetAutoPkTypes

public EnumSet<DbType> getTargetAutoPkTypes()

setTargetAutoPkTypes

public void setTargetAutoPkTypes(EnumSet<DbType> targetAutoPkTypes)
set to null to match all unique primary keys


itinerary

public Set<String> itinerary()
Description copied from interface: Visitor
A way to limit node traversal to a subset of model instances.

Specified by:
itinerary in interface Visitor
Overrides:
itinerary in class DefaultDatabaseVisitor
Returns:
set of tags defining a subset of model types to visit or null if all nodes should be visited.

visit

public void visit(PkColumn pkColumn)
Identify and set auto-increment primary keys using specified pattern.

Specified by:
visit in interface DatabaseVisitor
Overrides:
visit in class DefaultDatabaseVisitor


Copyright 2006-2006-2007 Outsource Cafe Inc.. All Rights Reserved.